2.EditText:就是TextView控件中的一个属性而已
3.Shape外形资源:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>
<!--设置边框的颜色与宽度->
<stroke
android:width="2dp"
android:color="#66000000"
></stroke>
<!--内边距-->
<padding
android:top="3dp"
android:bottom="3dp"
android:left="5dp"
></padding>
<corners
android:bottomLeftRadius="25dp"
android:bottomRightRadius="25dp"
android:topLeftRadius="25dp"
android:topRightRadius="25dp"
></corners>
<!--边框线的样式-->
<!--<solid
android:color="#ffff00"
></solid>-->
<!--将文本框内设置颜色-->
<gradient
android:startColor="#66ff0000"
android:centerColor="#6600ff00"
android:endColor="#660000ff"
></gradient>
</shape>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:drawable="@drawable/et_shape2"></item>
<item android:state_focused="false" android:drawable="@drawable/et_shape"></item>
</selector>
仅供参考(各位微博的小伙伴)
本文详细介绍了Android开发中常用的UI控件,包括TextView用于显示文本,EditText作为输入文本的控件,Shape资源定义了控件的外观样式,Selector用于创建不同状态下的视觉效果。通过对这些控件的学习,开发者可以更好地设计应用程序的用户界面。
665

被折叠的 条评论
为什么被折叠?



