android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background_user"
android:orientation="vertical" >
。。。。。。。。
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:gravity="center"
android:text="@string/featurelist_version"
android:textSize="16sp" />
</LinearLayout>
将该textview 显示在布局底部
为啥没有效果???
求教
weight不用设置这个吧
直接设置marg_butom这个属性吧
你说的没有效果应该是指没有显示在布局底部吧.android:gravity="center"这句的意思是让这个空间居中显示哦
又是居中又是底部?或者用相对布局RelativeLayout
你需要把布局改成RelativeLayout
FrameLayout,把LinearLayout改成
首先,你的代码肯定是copy的, 在linearlayout中没有alignParentBottom这个属性;linearlayout 中设置orientation为vertical时,layoutgravity属性中只有操作控件水平方向的参数才是有效的,margin-bottom 同样不会有效果。
其次,解决方法要不用relativelayout,要不就计算屏幕高度使用margin-top。建议你使用relativelayout。同时建议你好好学习几大布局,基础很重要。
要么用linearLayout 要么用相对布局,有点乱你这。