android - how to get my layout to be at the bottom of my activity -
android - how to get my layout to be at the bottom of my activity -
hello working on ios styled app has layout out bottom can't seem layout in question @ bottom
here's code:
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:weightsum="10" tools:context=".myactivity" tools:ignore="uselessleaf,contentdescription" > <android.support.v4.view.viewpager android:id="@+id/pager" android:layout_width="fill_parent" android:layout_height="0dp" android:layout_marginbottom="5dp" android:layout_weight="7" > </android.support.v4.view.viewpager> <com.viewpagerindicator.circlepageindicator android:id="@+id/pagerindicator" android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="0.5" android:padding="3dp" /> <linearlayout android:id="@+id/layout11" android:layout_width="match_parent" android:layout_height="30dip" android:background="@drawable/dock" android:layout_gravity="bottom" android:orientation="horizontal" > <linearlayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:gravity="center|bottom" tools:ignore="nestedweights" > <imageview android:id="@+id/dial" android:layout_width="wrap_content" android:layout_height="10dp" android:layout_gravity="center_horizontal|center" android:src="@drawable/dialer" tools:ignore="contentdescription" /> </linearlayout> <linearlayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_gravity="bottom" android:layout_weight="1" > <imageview android:id="@+id/back" android:layout_width="wrap_content" android:layout_height="10dp" android:layout_gravity="center_horizontal|center" android:src="@drawable/back" /> </linearlayout> <linearlayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_gravity="center_horizontal|center" android:layout_weight="1" > <imageview android:id="@+id/sms" android:layout_width="wrap_content" android:layout_height="10dp" android:layout_gravity="center_horizontal|center" android:src="@drawable/mms" /> </linearlayout> <linearlayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_gravity="center_horizontal|center" android:layout_weight="1" > <imageview android:id="@+id/music" android:layout_width="wrap_content" android:layout_height="10dp" android:src="@drawable/music" android:visibility="gone" /> </linearlayout> </linearlayout> </linearlayout> here's looks right now: image
i want buttons @ bottom of page
what doing wrong?
please allow me know
thanks 1000000 times on
chris
as hesam's reply pointed out when utilize layout_weight attribute in 2nd layout should create layout_height=0dp...if you're using android studio should giving warning it. however, i'd add together reply there's lot of room improvement in layout file whole...and mean lot!!! you've got phone call spaguetti of useless nested layouts. mention few
linearlayout absolutely useless...it's empty, not needed the root linearlayout can converted relativelayout, force bottom-most kid view bottom using layout_alignparentbottom=true , stack other children on top of bottom view using layout_above you have lot nested linearlayout 1 single child...imho useless you have lot nested relativelayout 1 single child...imho useless well i go on forever, should address these nested layout issues because adding lot of unnecessary overhead ui...this pretty heavy man
further recommendations based on screenshot addedthis recommend
i'd recommend usingrelativelayout root/top layout add listview display images/icons , set layout_alignparenttop=true layout_height=wrap_content then add together linearlayout below horizontal orientation display buttons android xml
Comments
Post a Comment