安卓学习笔记(一)TextView与EditText

来源:互联网 发布:九阴绝学声望回收数据 编辑:程序博客网 时间:2024/05/16 15:54

<TextView    

        android:id="@+id/textView1"    

        android:layout_width="wrap_content"    

        android:layout_height="wrap_content"    

        android:text="TextView" />


<EditText

        android:id="@+id/editText1"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_weight="1"android:ems="10"  />


wrap_content:包裹实际文档内容 
文字多大,TextView就多大。


match_parent:当前控件铺满父类容器 
2.3 api 后添加的属性。


fill_parent:当前控件铺满父类容器 
2.3 api 前的属性。


android:textSize:字体大小


android:textColor:字体颜色


android:hint:提示


android:text:实际内容


setContentView(R.layout.main_activity):将布局XML引入到源文件中。



0 0
原创粉丝点击