有一行有两个组件EditText和Button,Button靠最右,EditText宽度从最左到Button的左边,这个用相对布局,要怎么实现? 有一行有两个组件EditText和Button,Button靠最右,EditText宽度从最左到Button的左边,这个用相对布局,要怎么实现? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_alignParentRight="true" android:layout_width="100dip" android:layout_height="wrap_content" /> <EditText android:id="@+id/myEdit" android:layout_toLeftOf="@id/myButton" android:layout_width="match_parent" android:layout_height="wrap_content" /></RelativeLayout> 同意楼上,不过按LZ要求应该是android:orientation="horizontal" 2楼正解,不过如果是2.1以下的要改一下EditText的属性android:layout_width="fill_parent" 帮忙看看 还是关于跳转崩溃的问题……照着打了源码都不行 关于java中使用exec的问题 关于套接字接收汉字的显示问题 大家好我是新手,想问一个问题? 解决Android SDK Manager更新下载速度慢或无法下载的问题 垂直自动滚动问题(第一行固定,其他行自动滚动)有人知道怎么实现吗? android知栏的消息内容 求助,SDK安装不成功? 安卓的这种顶部tab怎么实现的 谁做过使用nand的android系统的 recovery模式? android 静默安装的问题!!!!!!!!!
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/myButton"
android:layout_alignParentRight="true"
android:layout_width="100dip"
android:layout_height="wrap_content"
/>
<EditText
android:id="@+id/myEdit"
android:layout_toLeftOf="@id/myButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</RelativeLayout>