Android之控件
来源:互联网 发布:数据库事务的原理 编辑:程序博客网 时间:2024/06/06 07:44
:本文为博主原创文章,未经博主允许不得转载。
1.TextView文本框的使用
新建一个项目(Model)
选中到Android--->找到你新建的项目--->res---->移动到layout上新建一个.xml文件
片段内容如下
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="网址:http://www.baidu.com。电话:18692238124。邮箱:http://1348867987qq.com" android:autoLink="all" android:typeface="sans" android:textStyle="bold" android:singleLine="true" android:ellipsize="marquee" android:focusable="true" android:focusableInTouchMode="true" android:drawableLeft="@drawable/icon_user" android:id="@+id/tv_main_text" />
2.EditText输入框的使用
代码片段如下
<EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="请输入电话号码" android:inputType="number" android:background="@drawable/et_selector" />
3.Shape外形资源
找到res下方的drawable右击new一个.xml文件
片段代码如下
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" ><solid android:color="#66ff00ff" ></solid> <corners android:radius="13dp" ></corners> <stroke android:width="1dp" android:color="#000000" ></stroke> <padding android:bottom="5dp" android:left="110dp" android:right="5dp" android:top="10dp" ></padding></shape>
4.Selector选择器
片段代码如下
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:drawable="@drawable/et_shape"></item> <item android:state_focused="false" android:drawable="@drawable/et_shape2"></item></selector>
阅读全文
0 0
- Android 控件之对话框
- Android 控件之ListView
- Android 控件之Spinner
- Android 控件之GridView
- Android 控件之GridView
- android控件之Textview
- android控件之EditText
- Android控件之ExpandableListView
- Android控件之ExpandableListView
- android控件之SeekBar
- Android控件之ListView
- Android控件之ListView
- Android控件之ExpandableListView
- android控件之imageView
- android控件之progressbar
- android控件之gallery
- android控件之AlertDialog
- android控件之popupWindow
- 使用ReleaseBuffer()后,CString类变量数据清空
- 29.结构体求出班级中最高分和学号,将学生信息按照成绩从高到低输出。
- 微信小程序开发一些经验总结
- GMM高斯混合模型进行背景建模(Matlab)
- 安卓之高级控件Spinner下拉框
- Android之控件
- R语言神器
- 1118. Birds in Forest (25)
- ubuntu 12.04 安装Docker 实战
- STM32 ST-LINK Utility解决错误提示“Can not read memory!Disable Read Out Protection and retry”
- 30. 完成sort函数,实现:按照成绩从高到低的顺序输出各学生的信息。
- ISO8583报文协议
- java——类——final
- 权限列表