Android中的FILL_PARENT与WRAP_CONTENT的区别
FILL_PARENT
Special value for the height or width requested by a View. FILL_PARENT means
that the view wants to be as big as its parent, minus the parent's padding, if
any. This value is deprecated starting in API Level 8 and replaced by MATCH_PARENT
.
fill_parent布局指将视图扩展以填充所在容器(也就是父容器)的全部空间。
WRAP_CONTENT
Special value for the height or width requested by a View. WRAP_CONTENT means
that the view wants to be just large enough to fit its own internal content,
taking its own padding into account.
wrap_content布局指根据视图内部内容自动扩展以适应其大小。
分享到:
相关推荐
android:layout_width="fill_parent" android:layout_height="fill_parent" > android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> android:id=...
android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="fill_horizontal" > android:id="@+id/address" android:layout_width="fill_parent" android:layout_height=...
android:layout_width="fill_parent" android:layout_height="wrap_content" android:collapseColumns="1"> <TableRow android:id="@+id/TableRow01" android:layout_width="fill_parent" android:layout_height...
layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:text="@string/username" android:textStyle="bold" android:textColor="#000000"/> <EditText android:layout_...
android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" > android:id="@+id/ImageView1" android:layout_width="wrap_...
android:layout_width="fill_parent" android:layout_height="fill_parent" zhy:position="left_top" zhy:radius="130dp" > android:layout_width="wrap_content" android:layout_height="wrap_content" ...
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1"> <Button android:id="@+id/mButton5" android:layout_...
android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="15dip" android:background="@drawable/background_login" android:padding="15dip" > android:id="@+...
main.xml代码如下: <?xml version="1.0" encoding="utf-8"?... android:layout_height="wrap_content" android:text="HTTPS Test" /> 将该Android项目运行起来,点击按钮,在logcat中就可以看到打印信息:
android:layout_width="wrap_content" android:layout_height="fill_parent"> <include layout="@layout/main_left" /> android:id="@+id/sliding_menu_view" android:layout_width="fill_parent" android...
在Android开发中,视图(View)的布局和排列是非常关键的一部分,尤其是在创建复杂的用户界面时。本篇文章将详细介绍如何在Android中将一个View置底,并通过实例解释如何在RelativeLayout布局中实现这一目标。同时,...
android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="vertical"> android:id="@+id/gallery" android:layout_width="fill_parent" android:layout_height=...
android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/image" /> _ImageView.java 代码 package com.webabcd.view; import android.app.Activity; import android....
android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:layout_width="135dip" android:textSize="18sp" android:layout_height="45dip" android:text="确定" android:id...
android:layout_height="fill_parent"> android:id="@+id/tvPlace" android:layout_width="fill_parent" android:layout_height="wrap_content" /> android:id="@+id/place" android:layout_width="fill_...
" "android:layout_width="fill_parent" " "android:layout_height="wrap_content" " "/> " "<ImageView android:id="+id/ImageView01" " "android:layout_width="wrap_content" " "android:layout_height="wrap_...
android:layout_width="fill_parent" android:layout_height="fill_parent"> android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="I am textview 1" /> android:...
1、WRAP_CONTENT、MATCH_PARENT/FILL_PARENT初入Android殿堂的同学们,对这三个属性一定又爱又恨。爱的是使用起来挺爽地---照葫芦画瓢即可,恨的却是时常混淆这几个属性地意义,需要三思而后行。在带着大家重温下这...
android:layout_width="fill_parent" android:orientation="vertical" android:layout_height="fill_parent"> android:gravity="center_horizontal" android:background="@drawable/myinfor2" android:...
android:layout_width="fill_parent" android:layout_height="fill_parent"> android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello"/> android:layout_...