Android studio 镜像到物理设备

问题描述 投票:0回答:1

我模拟器一切正常,当我在物理设备上启动程序时,一切突然翻转[这是来自模拟器这是来自物理设备](https://i.sstatic.net/AUK9Yb8J.jpg

我尝试使用不同的手机,但没有成功。

android xml kotlin android-studio
1个回答
0
投票

您在布局中给出了不好的约束,请尝试添加适当的约束或使用堆叠在其中的水平衬垫布局的衬垫布局

只是一个例子

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingStart="5sp"
        android:paddingEnd="5sp">

        <LinearLayout
            android:id="@+id/lay_main_order_view_reject_accept"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <com.google.android.material.button.MaterialButton
                android:id="@+id/btn_main_order_view_reject"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="end"
                android:layout_weight="1"
                android:backgroundTint="@color/black_light"
                android:text="Decline Order"
                android:textSize="12sp"
                android:textStyle="bold" />

            <com.google.android.material.button.MaterialButton
                android:id="@+id/btn_main_order_view_accept"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="end"
                android:layout_marginStart="3sp"
                android:layout_weight=".8"
                android:backgroundTint="#378C3A"
                android:text="Accept Order"
                android:textSize="12sp"
                android:textStyle="bold"
                app:icon="@drawable/accept_check_good_mark_ok_tick_svgrepo_com"
                app:iconGravity="textEnd"
                app:iconSize="20sp" />

        </LinearLayout>
© www.soinside.com 2019 - 2024. All rights reserved.