我的按钮被设置为按需大小(wrap_content);它确实有一个标题,但它是不可见的。它应该就在我的ListView下面,我想:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView
android:id="@+android:id/listviewContacts"
android:layout_width="match_parent"
android:layout_height="300dip"
android:scrollbars="vertical | horizontal" >
</ListView>
<Button
android:id="@+id/buttonSaveAndBegin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/save_settings_and_begin_responding" />
</LinearLayout>为什么我的按钮不显示?
发布于 2012-02-05 22:29:22
LinearLayout的默认方向是水平的。如果您将android:orientation=“垂直”添加到您的LinearLayout中,那么您应该已经设置好了。
发布于 2012-02-05 22:30:59
在您的线性布局中添加如下垂直起始点
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent" >并且不需要将垂直滚动视图属性添加到列表视图中.Listview附带了默认的垂直滚动视图
发布于 2012-02-05 22:27:16
可能是因为300倾角比屏幕高?
试着降低这个,看看你是否能看到它。
https://stackoverflow.com/questions/9153650
复制相似问题