2013-07-24 51 views
0

我有一个MainLayout,在Mainlayout内我有TabWidget和一个线性布局视图。
在特定的点i想要显示的帧布局,以便它显示填充,将填充整个屏幕(隐藏TabWidget和线性布局图)如何设置framelayout以适合整个屏幕?

如何设置大小/布局PARAMS为的FrameLayout整个屏幕

回答

-1

你应该使MainLayout成为一个RelativeLayout,在该RelativeLayout中放置TabWidget和LinearLayout,最后放置一个与父宽度和高度相匹配并且可见度消失的FrameLayout。

-2

您可能需要添加的FrameLayout MainLayout外布局文件,然后添加一个的LinearLayout/FrameLayout里与

的android:layout_width = “match_parent”,那么Android:layout_height = “match_parent”

MainLayout后。

现在,您可以通过控制LinearLayout/FrameLayout的可见性来隐藏MainLayout的内容。

0

你应该在你的主要布局的顶部,能见度增加的FrameLayout的另一层,并添加额外的FrameLayout =“水涨船高”

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <LinearLayout 
     android:id="@+id/main_layout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" >  
     ...  
    </LinearLayout> 

    <FrameLayout 
     android:id="@+id/occasional_layout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:visibility="gone" 
     >  
     ...  
    </FrameLayout> 
</FrameLayout>