Android之控件
来源:互联网 发布:信长野望长野业正数据 编辑:程序博客网 时间:2024/05/17 03:15
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>
阅读全文
1 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
- 关于HTML的几个技巧
- puthon中同步与互斥知识
- window下cmd命令窗口常用快捷键
- PHP学习笔记11:类和对象
- Leetcode(3)-找最大子串的长度
- Android之控件
- phpstrom2017最新注册码 2017-6-3
- 前端学习笔记3-js-DOM
- python网络
- Halcon算子参考
- Ubuntu资源查看
- UISegmentControl 分段控制器
- 【Python】5“条件判断和循环“
- Java动态代理实例