线性布局未覆盖整个屏幕

时间:2018-02-03 13:23:52

标签: java android android-layout

我的布局覆盖整个屏幕。我点击了一些东西突然间,每个屏幕上的整个布局都被推下了一点,当我运行它时,我的所有布局看起来都很奇怪。

这是它的外观。

enter image description here

如果你看一下图像,布局就不会像过去那样覆盖整个屏幕。我有我的主题。我不认为我偶然改变了我的主题。即使我这样做了,也不应该推倒其他屏幕上的所有布局。

当我发生这种情况时,我正在玩色彩值。

以下是我的XML的外观。

<?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"
    android:background="@color/colorAccent"
    android:orientation="vertical">

    <CheckBox
        android:id="@+id/checkBox"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="CheckBox" />

    <ToggleButton
        android:id="@+id/toggleButton"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="ToggleButton" />
</LinearLayout>

这就是风格的样子。

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

我可以将colorPrimaryDark更改为当前的白色,但在它不存在之前。 有人可以帮忙吗?

这只是一个测试布局btw

0 个答案:

没有答案
相关问题