插入框架布局内的另一个框架布局 [英] insert frame layout inside another frame layout
本文介绍了插入框架布局内的另一个框架布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以插入内的一个的FrameLayout 2的FrameLayout? 我想这code和它不工作!
Can i insert two frameLayout inside one frameLayout? I tried this code and it doesn't work!!!
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"
android:orientation="horizontal" >
<FrameLayout
android:id="@+id/titles"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1" />
<FrameLayout
android:id="@+id/details"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="2" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:baselineAligned="false"
android:orientation="horizontal" >
<FrameLayout
android:id="@+id/details1"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1" />
<FrameLayout
android:id="@+id/details2"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
</FrameLayout>
</LinearLayout>
当我点击一个元素上,我想detail1进行打印。我猜detail1已根据细节被创建,所以我不能看吗?
When i click on one element i want detail1 to be printed. I guess the detail1 has been created under details so i can't see it?
任何一个可以帮助吗?
还有就是我想要的:
There is what i want:
推荐答案
下面就是答案:
<?xml version="1.0" encoding="utf-8"?>
<!--
Top-level content view for the layout fragment sample. This version is
for display when in landscape: we can fit both titles and dialog.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:baselineAligned="false"
android:orientation="horizontal" >
<FrameLayout
android:id="@+id/titles"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1" />
<FrameLayout
android:id="@+id/details"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="2" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:baselineAligned="false"
android:orientation="horizontal" >
<FrameLayout
android:id="@+id/titles1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" />
<FrameLayout
android:id="@+id/details1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<FrameLayout
android:id="@+id/details2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
</RelativeLayout>
我得到了很好的效果:) 感谢每一个机构的帮助,谢谢
I got the good result :) thanks to every body help, thanks
这篇关于插入框架布局内的另一个框架布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文