摘要: 开始的布局为fragment与FrameLayout;将右边的FrameLayout替换为Fragment。源码链接:源码下载 阅读全文
posted @ 2013-02-10 23:15 My_苦行僧 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 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_苦行僧 阅读(4379) 评论(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_苦行僧 阅读(702) 评论(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) 编辑