[英]android Why is my RelativeLayout not working
初学者问题在这里!
看看图片,
我希望butten-edittext按钮填充屏幕的宽度。
键入文本的空间很小。
任何想法?
(一直在搜索和测试3小时)
这是我的xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/examplegallery"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<RelativeLayout
android:id="@+id/InnerRelativeLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<Button
android:id="@+id/btnNewPen"
android:layout_toLeftOf="@+id/edittextaddtext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pen"
/>
<EditText
android:id="@+id/edittextaddtext"
android:layout_width="wrap_content"
android:layout_toLeftOf="@+id/btnsave"
android:layout_height="wrap_content"
android:singleLine="true"
android:text=""
/>
<Button
android:id="@+id/btnsave"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="save"
/>
</RelativeLayout>
</RelativeLayout>
尝试这个:
<Button
android:id="@+id/btnNewPen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pen"
/>
<EditText
android:id="@+id/edittextaddtext"
android:layout_width="fill_parent"
android:layout_toLeftOf="@+id/btnsave"
android:layout_toRightOf="@+id/btnNewPen"
android:layout_height="wrap_content"
android:singleLine="true"
android:text=""
/>
剩下的就是这样。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.