`
stephen830
  • 浏览: 2978114 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Android中的FILL_PARENT与WRAP_CONTENT的区别

 
阅读更多

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中ratingbar的简单使用

    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=...

    SendSms.zip

    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控件大全以及各布局空间的使用方式

    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...

    ANDROID实验报告组件布局.pdf

    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应用开发电子书]

    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" ...

    计算器(android)

    <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_...

    login_interface

    android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="15dip" android:background="@drawable/background_login" android:padding="15dip" > android:id="@+...

    AndroidHttps服务器端和客户端简单实例

    main.xml代码如下: <?xml version="1.0" encoding="utf-8"?... android:layout_height="wrap_content" android:text="HTTPS Test" /> 将该Android项目运行起来,点击按钮,在logcat中就可以看到打印信息:

    android 右侧滑动菜单 主页滑动 窗帘效果 拉幕

    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(附_前置声明layout布局文件中的资源ID)

    在Android开发中,视图(View)的布局和排列是非常关键的一部分,尤其是在创建复杂的用户界面时。本篇文章将详细介绍如何在Android中将一个View置底,并通过实例解释如何在RelativeLayout布局中实现这一目标。同时,...

    android左右滚动焦点图【改】

    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常用控件的基本使用说明.doc

    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自定义弹出框

    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项目_-天气预报详解实例(免费)

    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实验指导.doc

    " "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完全介绍

    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:...

    Android中measure过程、WRAP_CONTENT详解以及

    1、WRAP_CONTENT、MATCH_PARENT/FILL_PARENT初入Android殿堂的同学们,对这三个属性一定又爱又恨。爱的是使用起来挺爽地---照葫芦画瓢即可,恨的却是时常混淆这几个属性地意义,需要三思而后行。在带着大家重温下这...

    Android开发—使用ActivityGroup来切换Activity和Layout

    android:layout_width="fill_parent" android:orientation="vertical" android:layout_height="fill_parent"> android:gravity="center_horizontal" android:background="@drawable/myinfor2" android:...

    在XML中定义View

    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_...

Global site tag (gtag.js) - Google Analytics