您的位置:首页 > 移动开发 > Android开发

Android LinearLayout layout_weight适应屏幕布局

2012-03-08 18:27 411 查看


废话不多说直接上代码:

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/title_background"
android:gravity="center"
android:orientation="horizontal" >

<ImageButton
android:id="@+id/back"
android:layout_width="100dp"
android:layout_height="fill_parent"
android:background="#00000000"
android:layout_weight="1"
android:src="@drawable/btn_back" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/allfeed_name"
android:textColor="#ffffff"
android:gravity="center"
android:layout_weight="2"
android:textSize="18dp">
</TextView>
<ImageButton
android:id="@+id/exit"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_weight="0"
android:src="@drawable/button_exit" />

</LinearLayout>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android layout