【发布时间】:2017-07-11 10:26:46
【问题描述】:
【问题讨论】:
-
您可以通过 sumWeight 在 1 个 LinearLayout 中使用 3 个片段。检查这个link
标签: android android-layout android-fragments tablet
【问题讨论】:
标签: android android-layout android-fragments tablet
你为什么不试试这个
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="match_parent"
tools:context=".MainActivity">
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#ff00"
/>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#000000"
/>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#009dff"
/>
在 3 个片段中添加任何内容,然后使用它们替换框架布局。
getSupportFragmentManager().beginTransaction().replace(R.layout.layout_name, new Fragment_name());
【讨论】:
一种简单的方法是同时使用左右抽屉!
看看下面的链接。
【讨论】: