Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you put FragmentTabhost on bottom
    primarykey
    data
    text
    <p>I want to put tabwidget on bottom like iPhone App. I know what this layout is against Google UserInterface guideline ,but i need.</p> <p>so,I have read many similar post in Stackoverflow. but every post isnt working.</p> <p>I want to use FragmentTabhost,without use External library (ex:ActionBarsherlock</p> <p>this is my code </p> <pre><code>&lt;android.support.v4.app.FragmentTabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/tabhost" android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;FrameLayout android:id="@+id/tabcontent" android:layout_width="0dp" android:layout_height="0dp" android:layout_above="@android:id/tabs" /&gt; &lt;FrameLayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="0dp" android:layout_above="@android:id/tabs" /&gt; &lt;TabWidget android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:orientation="horizontal" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p></p> <p>and activity code is below</p> <pre><code> protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_top); //set up FragmentTabhost FragmentTabHost host = (FragmentTabHost)findViewById(R.id.tabhost); host.setup(this,getSupportFragmentManager(),R.id.content); //add tabspec TabSpec tabSpec1 = host.newTabSpec("tab1"); Button btn1 = new Button(this); btn1.setBackgroundResource(R.drawable.icon1); tabSpec1.setIndicator(btn1); Bundle bundle1 = new Bundle(); bundle1.putString("name", "tab1"); host.addTab(tabSpec1,SampleFragment.class,bundle1); TabSpec tabSpec2 = host.newTabSpec("tab2"); Button btn2 = new Button(this); btn2.setBackgroundResource(R.drawable.icon2); tabSpec2.setIndicator(btn2); Bundle bundle2 = new Bundle(); bundle2.putString("name", "tab2"); host.addTab(tabSpec2,SampleFragment1.class,bundle2); } </code></pre> <p>so i have tried another layout like this</p> <pre><code>&lt;android.support.v4.app.FragmentTabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/tabhost" android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;FrameLayout android:id="@+id/tabcontent" android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="0" /&gt; &lt;TabWidget android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="0" android:orientation="horizontal" /&gt; &lt;FrameLayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" /&gt; &lt;/LinearLayout&gt; </code></pre> <p></p> <p>please help me,</p> <hr> <p><strong>Note</strong> finally I solved this ploblem. This is SupportPackage 's bug .....</p> <p>try this </p> <p><a href="http://code.google.com/p/android/issues/detail?id=40035" rel="nofollow">http://code.google.com/p/android/issues/detail?id=40035</a></p>
    singulars
    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.
 

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