android编辑框知识点练习 QQ说说发表页面的编写
- 实现效果
xml文件
<?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"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:background="#ffbed8db">
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="说点什么吧..."
android:gravity="top"
android:padding="5dp"
android:lines="6"
android:background="#fff"
android:layout_marginBottom="10dp"
android:inputType="textMultiLine"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/shi"
android:text="添加图片"
android:padding="8dp"
android:gravity="center_horizontal"
android:background="@drawable/didian"
android:textSize="20dp"/>
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/quan"
android:padding="8dp"
android:scaleType="fitXY"/>
</LinearLayout>
附:编辑框其他知识点
2. 在编辑框内绘制图像属性
3. 编辑框getText方法
4. 单行文本框
5. 设置字体背景的颜色,点击旁边的小正方形