简体   繁体   English

我如何摆脱底部的空白区域?

[英]How can I get rid of this empty white space on the bottom?

I get this random margin at the bottom of one of my layouts. 我在其中一个布局的底部获得了此随机边距。 It seems to be pushing the background upwards which is why part of the top is cut off(might not be that noticeable. http://i.imgur.com/NNWfIYh.png 似乎是在推高背景,这就是为什么顶部的一部分被剪掉的原因(可能不会那么明显。http://i.imgur.com/NNWfIYh.png

All I did recently was change the theme of my app. 我最近所做的只是更改应用程序的主题。 My MainActivity's layout doesn't show up like this, so i'm guessing it's a problem with this layout. 我的MainActivity的布局没有像这样显示,所以我猜想这是一个布局问题。 Here's the code 这是代码

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal" android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/choose_test_bg">


    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="64dp"
        android:id="@+id/linearLayout"
        android:layout_alignParentTop="true"
        >

        <ImageView
            android:src="@drawable/ta_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="T-A"
            android:id="@+id/buttonA"
            android:onClick="onButton1Click"
            android:layout_marginLeft="35dp"/>

        <ImageView
            android:src="@drawable/tb_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="T-B"
            android:id="@+id/buttonB"
            android:layout_marginLeft="10dp"
            android:onClick="onButton1Click"/>

        <ImageView
            android:src="@drawable/tc_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="T-C"
            android:id="@+id/buttonC"
            android:layout_marginLeft="10dp"
            android:onClick="onButton1Click"/>

        <ImageView
            android:src="@drawable/td_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="T-D"
            android:id="@+id/buttonD"
            android:layout_marginLeft="10dp"
            android:onClick="onButton1Click"/>


    </LinearLayout>

    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/linearLayout"
        android:layout_marginTop="42dp"
        android:id="@+id/linearLayout2">


        <ImageView
            android:src="@drawable/te_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="T-E"
            android:id="@+id/buttonE"
            android:layout_alignTop="@+id/linearLayout2"
            android:layout_toRightOf="@+id/linearLayout2"
            android:layout_toEndOf="@+id/linearLayout2"
            android:layout_marginLeft="35dp"/>

        <ImageView
            android:src="@drawable/tf_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="T-F"
            android:id="@+id/buttonF"
            android:layout_marginLeft="10dp"/>

        <ImageView
            android:src="@drawable/tg_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="T-D"
            android:id="@+id/buttonG"
            android:layout_marginLeft="10dp"
            android:onClick="onButton1Click"/>

        <ImageView
            android:src="@drawable/th_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="T-D"
            android:id="@+id/buttonH"
            android:layout_marginLeft="10dp"
            android:onClick="onButton1Click"/>

    </LinearLayout>



</RelativeLayout>

尝试将relativelayout的高度设置为match_parent

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何消除项目位置中的空白 - How Do I Get Rid of White Space in a Project Location 如何使用NestedScrollView删除CoordinatorLayout底部的空白空格 - How to remove empty white space at the bottom of CoordinatorLayout with NestedScrollView 如何摆脱元素周围的默认白色“空格”? - how to get rid of default white “space” around an element? 如何摆脱空白空间或不正确的加载在jQuery手机在Android中? - How to get rid of white space or improper loading in jquery mobile in android? 当我在swiprefreshlayout和nestedscrollview中使用webview时,如何删除webview底部的空白区域? - How can I remove white space on bottom of webview when i use webview in swiprefreshlayout and nestedscrollview? 如何在Android Studio中从scrollView底部删除白色空白 - How can i remove white blank space from bottom of scrollView in android studio Android:摆脱 EditText 底部的额外空间 - Android: get rid of extra space at the bottom of EditText Android webview周围有白色边框,我怎么能摆脱它? - Android webview has white border around it and how can i get rid of it? 如何使应用程序全屏并摆脱顶部状态栏+底部手势? - How can I make an app fullscreen and get rid of top status bar + bottom gesture? 如何摆脱ViewPager示例中的白框 - How do I get rid of a white frame in ViewPager sample
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM