Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From what I understand you want the clicked tab button to become the center tab button. </p> <p>One way to handle you issue would be to use buttons to handle switching between tabs. For this modify your xml file to look like</p> <pre><code> &lt;FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" android:visibility="gone"/&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="64dip"&gt; &lt;Button android:layout_height="fill_parent" android:layout_width="0dip" android:layout_weight="1.0" android:background="@drawable/ic_tab_artists" android:id="@+id/artist_id" android:onClick="tabHandler"/&gt; &lt;Button android:layout_height="fill_parent" android:layout_width="0dip" android:layout_weight="1.0" android:background="@drawable/ic_tab_artists" android:id="@+id/album_id" android:onClick="tabHandler"/&gt; &lt;Button android:layout_height="fill_parent" android:layout_width="0dip" android:layout_weight="1.0" android:background="@drawable/ic_tab_artists" android:id="@+id/song_id" android:onClick="tabHandler"/&gt; &lt;/LinearLayout&gt; &lt;/FrameLayout&gt; </code></pre> <p>Here I hide the tabwidget and place buttons in that possition. All the buttons call the same method. And inside the button listener I do</p> <pre><code>public void tabHandler(View target){ tab1Btn.setSelected(false); tab2Btn.setSelected(false); tab3Btn.setSelected(false); target.setSelected(true); if(target.getId() == R.id.artist_id){ tabHost.setCurrentTab(0); } else if(target.getId() == R.id.album_id){ tabHost.setCurrentTab(1); } else if(target.getId() == R.id.song_id){ tabHost.setCurrentTab(2); } } </code></pre> <p>Here I switch the tabs using the tab host. In this same method, you can write the code to remove the clicked button and re insert it into the middle position of the outerlayout. There can be easier solutions but you will need to do a trial and error as this. But this is one way to handle the requirement. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload