【发布时间】:2014-08-22 20:25:53
【问题描述】:
为什么android创建项目,如果fill_parent已经过期,给main.xml加上fill_parent,而不是match_parent?
我多次读到 match_parent 是您要使用的,而不是 fill_parent。
但我在执行android create project 命令时看到了这一点
c:\androidsdktools\sdk\platform-tools>android create project --activity acto --p
ackage a.b.c --target "android-20" --path c:\bleeeeh
查看它生成的 main.xml
我看到使用的是 fill_parent,而不是 match_parent。
但这是我下载的最新的android sdk。
c:\bleeeeh\res\layout>type main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout ..........
..........
android:layout_width="fill_parent"
........
</LinearLayout>
c:\bleeeeh\res\layout>
只是为了表明这是截至写作时最新的 android sdk.. 于 2014 年 7 月下载。Android-20
c:\androidsdktools\sdk\platforms>dir /ad
....
25/07/2014 09:56 AM <DIR> android-20
31/07/2014 10:32 PM <DIR> android-L
....
c:\androidsdktools\sdk\platforms>
虽然我甚至在 2012 年看到帖子说不应该使用 fill_parent,但应该使用 match_parent。
那么,为什么android在main.xml中使用fill_parent创建项目呢?
【问题讨论】:
标签: android android-layout sdk