一、常用控件:
文本控件:– TextView – EditText
按钮控件: – Button – ImageButton
状态开关按钮:– ToggleButton
单选与复选按钮:– CheckBox和RadioButton
图片控件:– ImageView
时钟控件:– AnalogClock – DigitalClock
日期与时间选择控件: – DatePicker – TimePicker
1.插入图片
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@mipmap/pic"/>
2.插入可编辑文本框:
<EditText
//控件id
android:id = "@+id/bjwbk"
//宽度与高度
android:layout_width="wrap_content" //或者match_parent
android:layout_height="wrap_content" //或者match_parent
//文本文字
android:text="文字"
//文本提示内容<

本文介绍了Android Studio中常见的控件和布局,包括TextView、EditText、Button、ImageView等控件,以及RelativeLayout、LinearLayout、TableLayout、GridLayout和AbsoluteLayout等布局的使用方法,通过实例展示了如何插入和配置这些元素。
最低0.47元/天 解锁文章
2564

被折叠的 条评论
为什么被折叠?



