您的位置:首页 > 其它

适配较好的写法

2015-07-01 17:06 232 查看
输入框用权重占满   按钮用包裹内容

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:tools="http://schemas.android.com/tools"

    android:id="@+id/container"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    tools:context="com.example.uilayouttest.MainActivity"

    tools:ignore="MergeRootFrame" >

    <EditText

        android:id="@+id/editText1"

        android:layout_width="0dp"

        android:layout_height="wrap_content"

        android:layout_weight="1"

        android:ems="10" >

        <requestFocus />

    </EditText>

    <Button

        android:id="@+id/button1"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:text="Button" />

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