Края раскладки клавиатуры появляются во время работы приложения? - PullRequest
1 голос
/ 27 мая 2020

enter image description here

This is a layout i created using dp dimensions using a relative layout for keyboard, But when i try the keyboard on my phone, somehow, the right edge of my keyboard gets cropped as shown below, what could be the reason for this problem?

enter image description here

Here's my xml code

<?xml version="1.0" encoding="utf-8"?>
 .... Множество кнопок .....  

Как было предложено в комментариях.

Я попытался изменить ширину моего родителя на некоторый постоянный dp вместо match_parent , но результат тот же.

ИЗМЕНИТЬ Я обнаружил, что эта ошибка возникает только на моем телефоне, который является Oreo, Xiaomi Redmi note 5.

1 Ответ

0 голосов
/ 30 мая 2020

вы можете использовать layout_weight

   <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:orientation="horizontal">

    <Button
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1" />

    <Button
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1" />

    <Button
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1" />

</LinearLayout>

его отзывчивость при отображении

...