首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么我的按钮不显示?

问为什么我的按钮不显示?
EN

Stack Overflow用户
提问于 2012-02-05 22:23:45
回答 5查看 134关注 0票数 0

我的按钮被设置为按需大小(wrap_content);它确实有一个标题,但它是不可见的。它应该就在我的ListView下面,我想:

代码语言:javascript
复制
<?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>

为什么我的按钮不显示?

EN

回答 5

Stack Overflow用户

回答已采纳

发布于 2012-02-05 22:29:22

LinearLayout的默认方向是水平的。如果您将android:orientation=“垂直”添加到您的LinearLayout中,那么您应该已经设置好了。

票数 4
EN

Stack Overflow用户

发布于 2012-02-05 22:30:59

在您的线性布局中添加如下垂直起始点

代码语言:javascript
复制
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:orientation="vertical"
        android:layout_height="match_parent" >

并且不需要将垂直滚动视图属性添加到列表视图中.Listview附带了默认的垂直滚动视图

票数 3
EN

Stack Overflow用户

发布于 2012-02-05 22:27:16

可能是因为300倾角比屏幕高?

试着降低这个,看看你是否能看到它。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9153650

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档