
Android 控件
文章平均质量分 77
石前有座桥
学生
展开
-
RadioButton
RadioButton是圆形单选框 2. RadioGroup是个可以容纳多个RadioButton的容器 3. 在RadioGroup中的RadioButton控件可以有多个,但同时有且仅有一个可以被选中<RadioGroup android:layout_width="wrap_content" android:layout_h...原创 2018-03-24 09:35:51 · 454 阅读 · 0 评论 -
SimpleExpandableListAdapter
SimpleExpandableListAdapter用于展开列表,比如QQ好友列表layout-activity_main: <ExpandableListView android:id="@+id/my_elv" android:layout_width="match_parent" android:layout_height="ma...原创 2018-03-29 10:09:30 · 846 阅读 · 0 评论 -
GridView+BaseAdapter
GridView+BaseAdapter相比GridView+SimpleAdapter可以较为自由的设置图片和文字layout-grid_item:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" a...原创 2018-03-28 15:32:28 · 597 阅读 · 0 评论 -
GridView+SimpleAdapter
layout-activity_main: <GridView android:id="@+id/my_gv" android:layout_width="match_parent" android:layout_height="match_parent" android:numColumns="3">3列 ...原创 2018-03-28 14:17:45 · 273 阅读 · 0 评论 -
BaseAdapter
相比于SimpleAdapter,不仅可以显示数据,还可以根据数据设定不同的逻辑。layout-item_info:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_hei...原创 2018-03-28 10:38:46 · 124 阅读 · 0 评论 -
SimpleAdapter
layout-item_info:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientatio...原创 2018-03-28 09:26:41 · 150 阅读 · 0 评论 -
状态选择器
res-drawable-bg_login.xml:<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@android:color/holo_blue_light" android:state_pressed="false"/>...原创 2018-04-03 09:59:19 · 351 阅读 · 0 评论 -
ViewPager
ViewPager可以起到翻页的效果res-layout-item_view_pager:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_pa...原创 2018-04-03 09:25:55 · 206 阅读 · 0 评论 -
Shape
res-drawable-rect_shape.xml:<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@android:color/holo_red_light"/>设置背景...原创 2018-04-01 14:06:46 · 164 阅读 · 0 评论 -
ListView
ListView允许用户通过手指上下滑动的方式将屏幕外的数据滚动到屏幕内,比如查看QQ聊天记录,翻阅微博最新消息等。方法一:entriesres-values-arrays.xml:mac小技巧:把全部苹果改成香蕉,把光标放到苹果1的 苹 前面,按住option,就可以拖过鼠标拖动选中全部苹果 <resources> <string-array name="fruit"&...原创 2018-03-25 09:43:06 · 159 阅读 · 0 评论 -
Spinner
方法一:字符串数组res-values:<?xml version="1.0" encoding="utf-8"?><resources> <string-array name="fruit"> <item>苹果</item> <item>原创 2018-03-24 16:17:46 · 170 阅读 · 0 评论 -
ProgressBar
进度条显示用 Style 属性来给 ProgressBar 确定样式,使用系统的attr:style="?android:attr/progressBarStyleHorizontal" <ProgressBar android:id="@+id/my_pb" android:layout_width="match_parent" androi...原创 2018-03-24 11:14:23 · 155 阅读 · 0 评论 -
SeekBar
SeekBar的主要应用在音乐播放,视频播放,或者对音量调节,屏幕亮度调节的一些操作中,让用户可以手动的去改变相应的值。<SeekBar android:id="@+id/my_seekbar" android:layout_width="match_parent" android:layout_height="wrap_content" ...原创 2018-03-24 10:41:53 · 2751 阅读 · 1 评论 -
BaseExpandableListAdapter
BaseExpandableListAdapter:支持动态加载layout-item_child:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="50d...原创 2018-03-29 15:28:10 · 488 阅读 · 0 评论