Fragment进阶(一)----->静态
来源:互联网 发布:windows vista重装 编辑:程序博客网 时间:2024/05/29 16:10
MainActivity.java
package com.example.fragmenttest;import android.os.Bundle;import android.support.v4.app.FragmentActivity;public class MainActivity extends FragmentActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);}}
activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <fragment android:name="com.example.fragmenttest.MyFragment" android:layout_width="0dp" android:layout_weight="1" android:layout_height="match_parent" /> <fragment android:name="com.example.fragmenttest.MyFragment2" android:layout_width="0dp" android:layout_weight="1" android:layout_height="match_parent" /></LinearLayout>
MyFragment.java
package com.example.fragmenttest;import android.os.Bundle;import android.support.v4.app.Fragment;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;public class MyFragment extends Fragment{@Overridepublic View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {return View.inflate(getActivity(), R.layout.fragment_article, null);}}
fragment_article.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="#EEE9E9"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="我是一个fragment界面" /></LinearLayout>
MyFragment2.java
package com.example.fragmenttest;import android.os.Bundle;import android.support.v4.app.Fragment;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;public class MyFragment2 extends Fragment{@Overridepublic View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {return View.inflate(getActivity(), R.layout.fragment_article2, null);}}
fragment_article2.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="我是一个fragment界面2" /></LinearLayout>
0 1
- Fragment进阶(一)----->静态
- Fragment学习进阶<一>-------静态
- Android 进阶 Fragment 介绍和使用 (一)
- 深入理解Fragment进阶系列(一):生命周期详解
- Fragment学习记录一 静态创建fragment
- android之碎片(fragment)一(静态添加)
- Android之Fragment(一):静态使用碎片
- Fragment基本使用(一)——静态加载布局
- python爬虫进阶(一):静态网页爬取
- Android进阶一:Fragment之间的数据通信
- Android进阶知识点(fragment)
- android (一) -fragment 的静态实现
- fragment进阶
- Android进阶之路 - Fragment(碎片化)、进栈、不进栈的简单使用(一)
- Fragment进阶(五)----->监听fragment回退事件
- Android进阶知识点(ViewPager,Fragment argument )
- 静态Fragment
- 静态Fragment
- 系统吞吐量、TPS(QPS)、用户并发量、性能测试概念和公式
- hdu1250
- 深入理解Tagged Pointer
- 集训队组队计划
- Mysql 查看连接数,状态
- Fragment进阶(一)----->静态
- oracle创建表空间
- 树 前序遍历,中序遍历,后序遍历
- 设计模式:14 观察者模式
- GdiPlus使用方法
- ios8新特性widget开发(自定义的通知栏样式)
- HTTP POST和GET区别简介
- FragmentActivity+FragmentTabHost+Fragement替代TabActibvity+TabHost+Activity
- Uncaught TypeError: Cannot read property 'options' of undefined 错误