布局无法正常工作 [英] layout not working as it should

查看:63
本文介绍了布局无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

5位玩家的布局:

6位玩家的布局:

在6个玩家布局中,当您单击第一个玩家"时,它会变得很奇怪(右图). 有人知道怎么了吗? 感谢您的帮助

At the 6 players layout when you click the First Player it gets weird(right image). Anyone know what is wrong? Thanks for any help

我的活动代码:

<ScrollView
    android:id="@+id/scrollView4"
    android:layout_width="320dp"
    android:layout_height="320sp"
    android:layout_marginBottom="8dp"
    android:layout_marginTop="8dp"
    app:layout_constraintBottom_toTopOf="@+id/button_basic_4"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.5"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/textView28">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        //edit texts...

    </LinearLayout>
</ScrollView>

推荐答案

这似乎是由于弹出了键盘而发生的.使用

This seems to happen because of the keyboard that is popping up. Use

<activity
            android:name=".ActivityName"
            android:screenOrientation="nosensor"
            android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />

如果您只想将应用程序用于纵向模式,请使用nosensor.如果您不想每次活动打开时android都弹出该键盘,请在<activity>中使用stateAlwaysHidden.

Use nosensor if you want to use the app only for portrait modes. Use stateAlwaysHidden in the <activity> if you don't want android to pop that keyboard up everytime your activity opens.

查看此链接官方文档.

这篇关于布局无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆