想要写个布局,底部是两个按钮,其余地方设置成imageview layout 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <RelativeLayout 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" > <Button android:id="@+id/bt1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="按钮左" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" /> <Button android:id="@+id/bt2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="按钮右" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" /> <ImageView android:id="@+id/iv" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_above="@id/bt1" /></RelativeLayout>看在分数的份上的 relativeLayoutimageview width和height都fill_parentlinearlayout/relativelayout中放两个按钮,一个left,一个right。这个layout居于parent Bottom,搞定。 <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ImageView android:id="@+id/imageView1" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="40" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:id="@+id/button1" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:text="Button" /> <Button android:id="@+id/button2" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:text="Button" /> </LinearLayout></LinearLayout> 这样的布局方法很多 楼上的都给出来了写布局时 先考虑你想要的效果 然后再根据你的实际需求来选用布局 充分的利用RelativeLayout 和 LinearLayout这两个混搭使用可以布局出你想要的效果 android'火焰.烟雾传感器数据接收处理 android上的播放器,一般怎么输出视频?surface 加载.so导致程序卡住 请教一个关于广播接收器优先级的问题,为什么我无论如何都不能超越QQ,360,GO等手机助手,管家? Spinner控件不可选 计算android 签名hash android如何实现图片预览功能 Android获取已连接远程蓝牙设备地址问题 急求 Android 百度地图 绘制多条折线方法 js android 交互错误 Uncaught TypeError 做手机网页前端用什么运行测试呢? 改变listview中某一个item的控件值,怎么对其单独刷新?
<RelativeLayout 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" >
<Button
android:id="@+id/bt1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="按钮左"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
/>
<Button
android:id="@+id/bt2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="按钮右"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
/>
<ImageView
android:id="@+id/iv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/bt1"
/></RelativeLayout>
看在分数的份上的
imageview width和height都fill_parent
linearlayout/relativelayout中放两个按钮,一个left,一个right。这个layout居于parent Bottom,搞定。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" > <ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="40" /> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" > <Button
android:id="@+id/button1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Button" /> <Button
android:id="@+id/button2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Button" /> </LinearLayout></LinearLayout>
这两个混搭使用可以布局出你想要的效果