本示例使用于4.0一下的Android系统

1、编写activity_main.xml文件

<LinearLayout 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"
    android:orientation="vertical"
    tools:context=".MainActivity" >

    <ImageView
        android:id="@+id/iv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1000" />

    <EditText
        android:id="@+id/et"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:singleLine="true"
        android:text="http://g.hiphotos.baidu.com/image/w%3D2048/sign=94bc5b60a50f4bfb8cd0995437777af0/86d6277f9e2f07083e861effe824b899a801f249.jpg" />

    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:onClick="click"
        android:text="commit" />

</LinearLayout>
View Code

相关文章: