android - 按钮未显示在模拟器中

标签 android android-layout android-xml

我的相关布局中有一个 ListView 和一个按钮。

它显示在 Eclipse 图形 View 中。但在模拟器listview中只显示。 按钮未在模拟器中显示。

我的 XML 代码在这里

 <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">


<ListView
    android:id="@+id/listView1"
    android:layout_width="match_parent"
    android:layout_height="415dp" >
</ListView>

<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/listView1"
    android:layout_centerHorizontal="true"
    android:onClick="submit"
    android:text="SUBMIT" />

</RelativeLayout>

我的 list 代码

 <uses-sdk
 android:minSdkVersion="14"
 android:targetSdkVersion="19" />


 <activity android:name="com.androidexample.tabbar.Tab1"
 android:theme="@android:style/Theme.DeviceDefault.NoActionBar">
 </activity>

谢谢你的帮助..

最佳答案

使用以下内容:

<ListView
    android:id="@+id/listView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above=@"+id/button1" >
</ListView>

<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_alignParentBottom="true"
    android:onClick="submit"
    android:text="SUBMIT" />

关于android - 按钮未显示在模拟器中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24596060/

相关文章:

Android多色.xml选择

android - 按钮和文本大小

Android:半透明覆盖?

Android:按名称获取自定义xml类对象的资源ID

php - 使用 CodeIgniter 和 MySQL 的 PhoneGap 应用程序?

android - TableLayout(TableRow?)在动态添加时未按预期调整 subview 的大小

android - 在 Android Wear 上实现 GridViewPager 的正确方法是什么?

android - SearchView 和 BackPress 事件处理

android - 如何以编程方式从 Android 中的 .vcf 文件导入或插入联系人?

android - 如何让Rotate3dAnimation更流畅?