- 博客(12)
- 收藏
- 关注
原创 Fragement的使用
Fragement(碎片) 的使用Fragment :在Activity中使用的碎片,有自己的布局、生命周期和输入事件 使用FragmentManager 作用:管理多个Frament之间的交互和传值的 android 3.0以前版本:当前Activity需要继承FragmentActivity并引入v4包 Activity.getFragmentManager(
2015-09-24 20:58:56 291
原创 CursorLoaderSms。 Loader 实现短信的即时刷新
注册表添加:获取短信的读写功能 MainActivity.java文件1.初始化UI控件public class MainActivity extends Activity implements LoaderCallbacks {private ListView listView;private TextView emptyTextView
2015-09-22 17:11:20 286
原创 ToggleButton
layout .xmlhttp://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" >
2015-09-12 15:50:25 287
原创 switch
Layout .xml 文件http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_paren
2015-09-12 15:41:00 233
原创 RadioButton的两种显示方式
在页面显示效果,单选按钮第一种方式: 实现onCheckedChangeListener接口layout.xml文件 http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" an
2015-09-12 15:09:14 955
原创 ImageView属性中需要注意的scaleType的用法
ImageView 属性:Android: src=“@drawable/” 图像资源Android:scaleType="center";//保持图片原尺寸,居中显示,超出部分不显示 Android:scaleType="centerCrop";//按比例扩大图片尺寸,居中显示,超出部分不显示Android:scaleType="centerInside";//
2015-09-11 20:04:08 242
原创 展示在屏幕上的控件的归纳
展示在屏幕上的控件:TextView文本控件:用于展示文本内容android:text 文本内容android:textSize 字号,单位:spandroid:textColor 文字颜色android:singleLine 设置是否单行显示android:drawable+四个方向 在文本控件中添加图片android:drawablepadding 图片
2015-09-11 19:52:26 586
原创 ImageButton 通过点击图像,完成提交的信息
ImageButton图像按钮: 通过图像点击Layout.xmlhttp://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_
2015-09-11 19:49:36 266
原创 checkBox用法
checkBox (复选按钮):1. layout.xml 布局文件http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout
2015-09-11 19:41:36 322
原创 button按钮的四种监听方式
实现Button 点击事件的四种监听方法:在logcat中可以查看打印日志第一种:自定义监听器:MainActivity.java ***包名****public class MainActivity extends Activity { private Button button; @Override protected void onCreate(Bun
2015-09-11 17:57:29 1543
原创 四种布局属性
线性布局LinearLayout:只能水平/垂直方向单一排列android:layout_width 宽android:layout_height 高 属性值:fill_parent(不推荐), match_parent(匹配父容器),wrap_content(包围内容), 自定义尺寸android:background 背景色 RGB,ARGBandroid:gravit
2015-09-11 17:29:23 283
原创 安卓的历代版本
Android操作系统曾有两个预发布的内部版本,它们的代号分别是铁臂阿童木(Astro)和发条机器人(Bender)Android 1.5 Cupcake(纸杯蛋糕)2009.4.30 Android 1.6 Donut(甜甜圈)2009.9.15Android 2.0/2.0.1/2.1 Eclair(松饼)2009.10.26Android 2.2/2.2.1 Froyo(冻
2015-09-11 17:26:41 742
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人