match_parent的使用

时间:2014-11-08 10:20:38   收藏:0   阅读:119

如果一个控件的宽、高使用match_parent属性,表示该控件的宽、高占剩下的所有区域。

例:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >
    
    <Button 
        android:id="@+id/login_btn"
        android:text="Login"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dip"
        />
    <WebView 
        android:id="@+id/login_webview"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:layout_margin="5dip"
        />

</LinearLayout>

效果:

bubuko.com,布布扣

原文:http://www.cnblogs.com/achsnw/p/4082752.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!