上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要: fragment作用:用于多屏显示,可以把activity里面的逻辑进行分离。3.0的时候就开始有的(平板),4.0被加载到手机中。fragment也可以看成一个view,依附于activity之上,fragment的生命周期可以说是由activity来控制的。fragment上面必须有view才能被显示。fragment:在布局中必须指定id和全类名 如下:1 <fragment2 android:id="@+id/fragment"3 android:layout_width="fill_parent"4 android:layout... 阅读全文
posted @ 2013-02-10 21:15 My_苦行僧 阅读(4380) 评论(0) 推荐(0) 编辑
摘要: 上下文菜单一般是真针对ListView(多条数据的操作) 需求:在ListView中显示通话记录的电话号码,长按显示的上下文菜单为复制号码到拨号盘、发送信息、复制号码,与之相对应的事件。 布局代码: 1 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 android:layout_width="match_parent" 3 android:layout_height="match_parent" 4 android:orien 阅读全文
posted @ 2013-02-10 19:43 My_苦行僧 阅读(709) 评论(0) 推荐(0) 编辑
摘要: demores/menu/menu.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <menu xmlns:android="http://schemas.android.com/apk/res/android" > 3 4 <item 5 android:id="@+id/menu_new" 6 android:icon="@android:drawable/ic_menu_help" 7 android:title= 阅读全文
posted @ 2013-02-10 17:13 My_苦行僧 阅读(2327) 评论(0) 推荐(0) 编辑
摘要: 布局代码: 1 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 android:layout_width="match_parent" 3 android:layout_height="match_parent" 4 android:orientation="vertical" > 5 6 <Button 7 android:layout_width="wrap_content" 阅读全文
posted @ 2013-02-10 01:33 My_苦行僧 阅读(588) 评论(0) 推荐(0) 编辑
摘要: 分页加载数据Demo:当客户端从服务端获取数据量过大,一般为用户考虑流量,我们都需要对数据进行分页加载(譬如图片bitmap等)布局代码:listview 1 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 android:layout_width="match_parent" 3 android:layout_height="match_parent" 4 android:orientation="vertical& 阅读全文
posted @ 2013-02-09 22:29 My_苦行僧 阅读(4068) 评论(0) 推荐(0) 编辑
摘要: 指定标签与自定义标签的示例布局代码: 1 <TabHost xmlns:android="http://schemas.android.com/apk/res/android" 2 android:id="@+id/tabhost" 3 android:layout_width="match_parent" 4 android:layout_height="match_parent" 5 android:orientation="vertical" > 6 7 <LinearL 阅读全文
posted @ 2013-02-09 11:51 My_苦行僧 阅读(2642) 评论(0) 推荐(1) 编辑
摘要: layer-list:两张图片和成一张图片state-list:状态图,如button按钮的点击,点击前与点击时的状态颜色不一样。level-list:打分图片shape:绘制形状图片布局代码: 1 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 android:layout_width="match_parent" 3 android:layout_height="match_parent" 4 android:orienta 阅读全文
posted @ 2013-02-09 08:07 My_苦行僧 阅读(7904) 评论(0) 推荐(0) 编辑
摘要: 1 <receiver android:name=".ViewWidget" android:label="@string/app_name">2 ....3 <meta-data android:name="cn.android" android:value="liming"/> 4 <meta-data android:name=“age" android:value=“30"/> 5 <!-- 使用资源文件中存放的字符串数据 -->6 < 阅读全文
posted @ 2013-02-08 23:53 My_苦行僧 阅读(3726) 评论(0) 推荐(1) 编辑
摘要: WebView:可以直接加载网页。webview 可以把一个java对象传递给网页,让javascript调用这个对象里面的方法。具体示例demo html代码: 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2 <html> 3 <head> 4 <meta http-equiv="Content-Type" content=&q 阅读全文
posted @ 2013-02-08 17:34 My_苦行僧 阅读(1000) 评论(0) 推荐(0) 编辑
摘要: widget桌面小控件创建步骤:1 写一个类extends AppWidgetProvider 2 在清单文件件中注册:1 <receiver android:name=".ExampleAppWidgetProvider" >2 <intent-filter>3 <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />4 </intent-filter>5 <meta-data android:n... 阅读全文
posted @ 2013-02-07 16:17 My_苦行僧 阅读(1115) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 下一页