码迷,mamicode.com
首页 > 系统相关 > 详细

Eclipse布局文件添加两个TextView,为什么运行后置显示一个

时间:2015-06-26 16:15:11      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:

下面是布局文件里的代码,有两个TextView,但是为什么运行后只显示第一个TextView??
 1 <?xml version="1.0" encoding="utf-8"?>
 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     android:layout_width="match_parent"
 4     android:layout_height="match_parent"
 5     android:orientation="vertical" >
 6     <TextView
 7         android:layout_width="match_parent"
 8         android:layout_height="match_parent" 
 9         android:text="第一个TextView"/>
10     
11     <TextView
12         android:layout_width="match_parent"
13         android:layout_height="match_parent" 
14         android:text="第二个TextView"/>
15 
16 </LinearLayout>

解决办法:
android:layout_width="match_parent"

android:layout_height="match_parent"

改成wrap_content吧

Eclipse布局文件添加两个TextView,为什么运行后置显示一个

标签:

原文地址:http://www.cnblogs.com/wsjwin/p/4602509.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!