Android常用控件

        一.Textview(显示文本的控件)

                      android :text    设置文本框内文本内容

                      android :autoLink   是否将符合指定格式的文本转换为可单击的超链接形式

                                                  取值范围:none  |   web  |   email  |      phone    |  map  |   all

                      android:singleLine       为true文本框不会换行

                      android    : lines  默认占几行

                     android     : minLines    最少占几行

                    android     : textColor       字体颜色

                    android :   textSize   字体大小

                    android  :  testStyle 字体风格如粗体斜体等

                    android :backgrount   设置背景

                 如下代码 

                                <TextView
                                                  android:layout_width="wrap_content"
                                                  android:layout_height="wrap_content"
                                                  android:autoLink="all"
                                                  android:textStyle="bold|italic"
                                                  android:textSize="30sp"
                                                  android:typeface="sans"
                                                  android:singleLine="true"
                                                 android:ellipsize="marquee"
                                                  android:focusable="true"
                                                  android:focusableInTouchMode="true"
                                                  android:clickable="true"
                                                  android:id="@+id/tv_main_text"
                                                  android:drawableLeft="@drawable/icon_user"
                                                  android:text="我的电话:18692238124。邮箱:352343589@qq.com。百度一下:http://www.baidu.com" />        


                      EditText(编辑文本的控件)

                                                  android :password     密码框

                                                   android :textColorHighight       文本被选中时的背景颜色


                                  代码演示如下:

                                                   <EditText
                                                        android:layout_width="match_parent"
                                                        android:layout_height="wrap_content"
                                                        android:hint="请输入密码"
                                                        android:inputType="number"
                                                        android:background="@drawable/et_selector"
                                                       />

                     外形资源(Shappe)

                                               android :radius   设置四个角的幅度

                                                abdroid :  xxxradius   设置某一个角的幅度

                                代码如下:

                                                   <!--弧度-->
                                                                   <corners
                                                                         android:topLeftRadius="50dp"
                                                                         android:bottomRightRadius="50dp"
                                                                    ></corners>


                                 <stroke/>定义几何形状的边框

                                                                   android :width    边框的宽度

                                                                  android : color 边框的颜色

                                                                  android : dashWidth  虚线的宽度

                                                                 android :  dashGap   虚线的间距

                                <color name=""></color>

                                      selector 选择器

                                               android:state_focused=""

                                              d


danroid :drawable   =""



            

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值