玩转Android---UI篇---TextView(文本框)
来源:互联网 发布:c语言平方怎么写 编辑:程序博客网 时间:2024/06/05 00:41
原址:http://hualang.iteye.com/category/143855
TextView比较简单,不能够用来进行编辑,只能够用来显示信息
布局文件里的一些常用的XML属性
android:gravity---用来设置控件内文本的对齐方式
android:layout_gravity---相对于父控件来说,用于设置控件的对齐方式
android:text---用来设置控件文本信息
android:layout_width---用来设置控件的宽度
android:layout_height---用来设置控件的高度
android:background---用来设置控件的背景色
android:textColor---用来设置控件内文本的颜色
android:textSize---用来设置控件的文本字体大小
android:width和android:height---功能与android:layout_width相似
区别:
android:layout_width只能设置fill_parent(横向填充整个屏幕)或
wrap_content(横向填充控件本身大小)
android:width设置具体控件的横向大小 单位是像素
例如:TextView显示
main.xml布局文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
- 玩转Android---UI篇---TextView(文本框)
- android入门(一)---UI组件之文本框(TextView)
- android-UI组件实例大全(一)------TextView文本框
- android-UI组件实例大全(一)------TextView文本框
- android-UI组件实例大全(一)------TextView文本框
- android-UI组件实例大全(一)------TextView文本框
- 玩转Android---UI篇---Dialog(对话框) (转)
- 玩转Android---UI篇---Button(按钮)
- 玩转Android---UI篇---Toast(提示)
- 玩转Android---UI篇---RadioButton(单选按钮)
- 玩转Android---UI篇---CheckBox(多选按钮)
- 玩转Android---UI篇---Menu(菜单)
- 玩转Android---UI篇---AutoCompleteTextView(自动提示)
- 玩转Android---UI篇---Dialog(对话框)
- 玩转Android---UI篇---WebView(网络视图)
- 玩转Android---UI篇---GridView(网格布局)
- 玩转Android---UI篇---Gallery(画廊视图)
- 玩转Android---UI篇---Spinner(下拉列表)
- 关于网络图片的采样与压缩保存
- POJ 3259 Wormholes
- LeetCode-Binary Tree Postorder Traversal
- 中小型企业如何选择服务器配置?
- C语言主要做哪些方面的开发---一个来自“IT技术学习”微信群的问题及答复
- 玩转Android---UI篇---TextView(文本框)
- 喜闻乐见的 2048 游戏 (附源码)
- WebSocket对象的“readyState”属性记录连接过程中的状态值
- 在Ubuntu平台上创建Cordova Camera HTML5应用
- ABAP table control
- 均方根值(RMS)+ 均方根误差(RMSE)+标准差(Standard Deviation)
- SmartImageView 智能异步的ImageView
- 软件开发工具 (四)——技术
- Android控件开发之Gallery