Fragment应用的几种方法
1,什么是Fragment
Fragment的意为碎片,在Android studio中可以理解为在一个Activity中进行不同界面的切换。
2,用Fragment能解决什么问题
Fragment可以解决不同屏幕分辨率的适配问题。
3,Fragment静态加载方法
Fragment静态加载,实现同一界面上存在不同的界面。
- Fragment的XML展示:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<fragment
android:id="@+id/f_one"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:name="com.example.abc.myapplication.fragment.BlankFragment"
//Fragment的路径
/>
<fragment
android:id="@+id/f_two"
android:layout_width="0dp"
android:layout_weight=