关于Android的组件使用中出现的一些问题(一)

1. 线性布局中,orientation为horizontal时,只显示第一个组件,其他组件不显示。

如图:

关于Android的组件使用中出现的一些问题(一)

 

原因:第一个组件的layout_width设置为了铺满match_parent,把后面的组件给盖住了。

 

<TextView
             android:text="爱好:"
             android:layout_width="match_content"
             android:layout_height="wrap_content"/>

 

 

 

 

 修改:layout_width设置为了自适应wrap_parent即可。

<TextView
             android:text="爱好:"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"/>

结果:

关于Android的组件使用中出现的一些问题(一)

 

关于Android的组件使用中出现的一些问题(一)

上一篇:什么叫应用程序域(AppDomain)?


下一篇:一、FileAndIOStream-FileInfo基本操作