是否可以将Google I / O中的Android仪表板模式用作片段,以便在平板电脑上以横向模式显示左侧的仪表板,而当前类别的内容显示在右侧?
我尝试过类似下面代码的内容,但它不起作用。
main.xml中:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Include dashboard -->
<include layout="@layout/fragment_dashboard"/>
<!-- Include details -->
<fragment
android:id="@+id/fragment_details"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.example.fragments.Details" />
</LinearLayout>
Details.java:
public class Details extends Fragment
{
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
{
View view = inflater.inflate(R.layout.details, container, false);
return view;
}
}