EditText 和 Button 制作输入框

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

    <EditText
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:id="@+id/editText"
        android:layout_weight="4"
        android:hint="Input something..."
        />

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/button_1"
        android:layout_weight="1"
        android:text="Button 1"
        />
</LinearLayout>

效果:

EditText演示.jpg



文件结构:

文件结构
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容