用android:layout_toLeftOf后,控件看不见

代码如下,求解<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns... 代码如下,求解

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" > <Button android:id="@+id/button" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="center" android:textSize="16dp" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/button" android:text="button_left" > </Button> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@id/button" android:text="button_above" > </Button></RelativeLayout>
展开
 我来答
M一花一世界L
2014-01-20 · TA获得超过162个赞
知道答主
回答量:91
采纳率:0%
帮助的人:44.9万
展开全部
第一个<button> 你设置的layout_width宽度的填满整个屏幕, 所以第二个<button> toLeftOf之后,会藏在屏幕左边,看不到

你可以把第一个<button> 的layout_width也设置成“wrap_content”试试!
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
匿名用户
2014-01-19
展开全部
应该是layout_width="wrap_content"
追问
谢谢啦  虽然不管用..
追答
把外层的relativelayout中的gravity去掉,button设置layout_centerInParent……
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
leegf17
2014-01-19 · TA获得超过1016个赞
知道小有建树答主
回答量:365
采纳率:100%
帮助的人:338万
展开全部
id为button控件的宽度改成wrap_parent。
追问
您的意思是wrap_content吧?改过去也不行诶   谢谢啦
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式