在Play商店发布后Android破碎的布局

时间:2017-07-12 10:42:36

标签: java android android-layout

我在Play商店发布我的应用程序但是我遇到了一个大问题。按钮坏了,但是当我在Android Studio的模拟器上测试时,我不会遇到任何问题。

模拟器测试SS:https://i11.servimg.com/u/f11/14/39/00/71/applic11.png

发布SS后:https://i11.servimg.com/u/f11/14/39/00/71/applic10.png

Android清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.test_button"
    android:versionCode="23"
    android:versionName="1.0" android:installLocation="auto">

    <uses-sdk
        android:minSdkVersion="15"
        android:targetSdkVersion="26" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>

    <application
        android:allowBackup="true"
        android:largeHeap="true"
        android:supportsRtl="true"
        android:hardwareAccelerated="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Holo.Light.DarkActionBar">
        <activity android:name="com.test_button.launcher">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity
            android:name="com.test_button.MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="landscape">

        </activity>
        <activity android:name="com.test_button.settingsactivity"
            android:parentActivityName="com.test_button.MainActivity"
            android:label="@string/ayarlar2"
            android:screenOrientation="landscape"
            tools:targetApi="jelly_bean">
        </activity>
    </application>

</manifest>

布局:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@mipmap/boot1"
    tools:context="com.test_button.MainActivity">

    <WebView
        android:id="@+id/tara2"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:visibility="invisible"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:layout_constraintLeft_creator="1"
        tools:layout_constraintTop_creator="1" />

    <Button
        android:id="@+id/Video4"
        android:layout_width="270dp"
        android:layout_height="120dp"
        android:layout_marginLeft="0dp"
        android:layout_marginRight="6dp"
        android:layout_marginTop="6dp"
        android:width="270dp"
        android:height="100dp"
        android:background="@drawable/button_in_4"
        android:backgroundTintMode="src_in"
        android:text="@string/Matrix_input_4"
        android:textColor="@android:color/white"
        android:textSize="30sp"
        android:textStyle="bold"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintLeft_toLeftOf="@+id/Video3"
        app:layout_constraintRight_toRightOf="@+id/Video3"
        app:layout_constraintTop_toBottomOf="@+id/Video3"
        tools:layout_constraintBottom_creator="1"
        tools:layout_constraintLeft_creator="1"
        tools:layout_constraintRight_creator="1"
        tools:layout_constraintTop_creator="1" />

    <Button
        android:id="@+id/Video3"
        android:layout_width="270dp"
        android:layout_height="120dp"
        android:layout_marginLeft="0dp"
        android:layout_marginRight="8dp"
        android:layout_marginTop="6dp"
        android:width="270dp"
        android:height="100dp"
        android:background="@drawable/button_in_3"
        android:backgroundTintMode="src_in"
        android:text="@string/Matrix_input_3"
        android:textColor="@android:color/white"
        android:textSize="30sp"
        android:textStyle="bold"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintLeft_toLeftOf="@+id/Video2"
        app:layout_constraintRight_toRightOf="@+id/Video2"
        app:layout_constraintTop_toBottomOf="@+id/Video2"
        tools:layout_constraintBottom_creator="1"
        tools:layout_constraintLeft_creator="1"
        tools:layout_constraintRight_creator="1" />

    <Button
        android:id="@+id/Video2"
        android:layout_width="270dp"
        android:layout_height="120dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="-7dp"
        android:layout_marginTop="6dp"
        android:width="270dp"
        android:height="100dp"
        android:background="@drawable/button_in_2"
        android:backgroundTintMode="src_in"
        android:text="@string/Matrix_input_2"
        android:textColor="@android:color/white"
        android:textSize="30sp"
        android:textStyle="bold"
        app:layout_constraintHorizontal_bias="1.0"
        app:layout_constraintLeft_toLeftOf="@+id/Video1"
        app:layout_constraintRight_toRightOf="@+id/Video1"
        app:layout_constraintTop_toBottomOf="@+id/Video1"
        tools:layout_constraintBottom_creator="1"
        tools:layout_constraintLeft_creator="1"
        tools:layout_constraintRight_creator="1" />

    <Button
        android:id="@+id/Video1"
        android:layout_width="270dp"
        android:layout_height="120dp"
        android:layout_marginLeft="83dp"
        android:layout_marginTop="119dp"
        android:width="270dp"
        android:height="100dp"
        android:background="@drawable/button_in_1"
        android:backgroundTintMode="src_in"
        android:text="@string/Matrix_input_1"
        android:textColor="@android:color/white"
        android:textSize="30sp"
        android:textStyle="bold"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:layout_constraintBottom_creator="1"
        tools:layout_constraintLeft_creator="1" />

    <Button
        android:id="@+id/VoutA"
        android:layout_width="270dp"
        android:layout_height="120dp"
        android:layout_marginRight="73dp"
        android:layout_marginTop="119dp"
        android:width="270dp"
        android:height="70dp"
        android:background="@drawable/button_out"
        android:backgroundTintMode="src_in"
        android:text="@string/Matrix_out_1"
        android:textColor="@android:color/white"
        android:textSize="30sp"
        android:textStyle="bold"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:layout_constraintBottom_creator="1"
        tools:layout_constraintRight_creator="1" />

    <Button
        android:id="@+id/VoutB"
        android:layout_width="270dp"
        android:layout_height="120dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="0dp"
        android:layout_marginTop="6dp"
        android:width="250dp"
        android:height="60dp"
        android:background="@drawable/button_out"
        android:backgroundTintMode="src_in"
        android:text="@string/Matrix_out_2"
        android:textColor="@android:color/white"
        android:textSize="30sp"
        android:textStyle="bold"
        app:layout_constraintHorizontal_bias="1.0"
        app:layout_constraintLeft_toLeftOf="@+id/VoutA"
        app:layout_constraintRight_toRightOf="@+id/VoutA"
        app:layout_constraintTop_toBottomOf="@+id/VoutA"
        tools:layout_constraintBottom_creator="1"
        tools:layout_constraintLeft_creator="1"
        tools:layout_constraintRight_creator="1" />

    <Button
        android:id="@+id/VoutC"
        android:layout_width="270dp"
        android:layout_height="120dp"
        android:layout_marginLeft="0dp"
        android:layout_marginRight="8dp"
        android:layout_marginTop="6dp"
        android:width="270dp"
        android:height="60dp"
        android:background="@drawable/button_out"
        android:backgroundTintMode="src_in"
        android:text="@string/Matrix_out_3"
        android:textColor="@android:color/white"
        android:textSize="30sp"
        android:textStyle="bold"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintLeft_toLeftOf="@+id/VoutB"
        app:layout_constraintRight_toRightOf="@+id/VoutB"
        app:layout_constraintTop_toBottomOf="@+id/VoutB"
        tools:layout_constraintBottom_creator="1"
        tools:layout_constraintLeft_creator="1"
        tools:layout_constraintRight_creator="1" />

    <Button
        android:id="@+id/VoutD"
        android:layout_width="270dp"
        android:layout_height="120dp"
        android:layout_marginLeft="0dp"
        android:layout_marginRight="6dp"
        android:layout_marginTop="6dp"
        android:width="250dp"
        android:height="60dp"
        android:background="@drawable/button_out"
        android:backgroundTintMode="src_in"
        android:text="@string/Matrix_out_4"
        android:textColor="@android:color/white"
        android:textSize="30sp"
        android:textStyle="bold"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintLeft_toLeftOf="@+id/VoutC"
        app:layout_constraintRight_toRightOf="@+id/VoutC"
        app:layout_constraintTop_toBottomOf="@+id/VoutC"
        tools:layout_constraintBottom_creator="1"
        tools:layout_constraintLeft_creator="1"
        tools:layout_constraintRight_creator="1" />

    <TextView
        android:id="@+id/textView4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="172dp"
        android:layout_marginStart="92dp"
        android:layout_marginTop="53dp"
        android:gravity="center"
        android:text="@string/baslikgiris"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="@android:color/white"
        android:textSize="36sp"
        android:textStyle="bold"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:layout_constraintBottom_creator="1"
        tools:layout_constraintLeft_creator="1" />

    <TextView
        android:id="@+id/textView5"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="100dp"
        android:layout_marginRight="164dp"
        android:layout_marginTop="53dp"
        android:gravity="center"
        android:text="@string/baslikcikis"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="@android:color/white"
        android:textSize="36sp"
        android:textStyle="bold"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:layout_constraintBottom_creator="1"
        tools:layout_constraintRight_creator="1" />
</android.support.constraint.ConstraintLayout>

我找不到任何解决方案。有人可以帮我解决这个问题吗?感谢

2 个答案:

答案 0 :(得分:0)

尝试使用RelativeLayout代替ConstraintLayout。

答案 1 :(得分:0)

您不能将webview用作子项布局检查下面的链接 https://developer.android.com/reference/android/webkit/WebView.html

您可以使用以下Jsoup:https://jsoup.org/

你也将bot高度和宽度设置为0,你需要更改

        android:layout_width="0dp"
        android:layout_height="0dp"