Android FragmentTabHost Layout Positioning -



Android FragmentTabHost Layout Positioning -

i learning android development , trying create tab interface within fragment, tabs in bottom. have seen many web pages (like one) how configure tabs in bottom using relativelayout can't things right in screen.

the tab's framelayout taking space tab interface, , tabs can't seen:

the code using is:

<android.support.v13.app.fragmenttabhost android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@android:id/tabhost" android:layout_marginright="5dp" android:layout_aligntop="@+id/ibright" android:layout_alignbottom="@+id/ibright" android:layout_toleftof="@+id/ibright" android:layout_alignleft="@+id/ibtop"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent"> <tabwidget android:id="@android:id/tabs" android:layout_alignparentbottom="true" android:layout_width="match_parent" android:layout_height="wrap_content" /> <framelayout android:id="@android:id/tabcontent" android:layout_width="match_parent" android:layout_height="wrap_content" /> </relativelayout> </android.support.v13.app.fragmenttabhost>

just quick test, adjusted framelayout width , height fixed (500dp , 200dp), , that's got:

so way can see things there, can't shown right, without playing fixed width , height numbers. , fact android studio has bug causes null reference rendering fragmenttablayout create things harder play with, since can't test alternative in real time.

i appreciate if can help me this, since new android, not quite sure how done.

got work next code:

<android.support.v13.app.fragmenttabhost android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@android:id/tabhost" android:layout_marginright="5dp" android:layout_aligntop="@+id/ibbannerright" android:layout_alignbottom="@+id/ibbannerright" android:layout_toleftof="@+id/ibbannerright" android:layout_alignleft="@+id/ibbannertop"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent"> <tabwidget android:id="@android:id/tabs" android:layout_alignparentbottom="true" android:layout_width="match_parent" android:layout_height="wrap_content" /> <framelayout android:id="@android:id/tabcontent" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_above="@android:id/tabs"/> </relativelayout> </android.support.v13.app.fragmenttabhost>

the secret ingredient android:layout_above="@android:id/tabs"

now seems fine:

android android-layout tabs

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -