GridLayoutを使用してSoundboardを作成しました。これはどのように見えるか、Huawei P8 Liteでどのように見えるかです:https://gyazo.com/2a08bcd731fb1cfeb07e72f75bc05e7eGridLayoutの使用方法を教えてください。
これは、Bluestacks、Noxplayer、およびDeviceを私の友人から見た方法です。
XMLコードISTここhttps://gyazo.com/84d878061234c25ae872d4ed2491f2f4
:(これはボタンのわずか2行の例であり、normaly 100行がある)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<GridLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/button1"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:text="Button"/>
<Button
android:id="@+id/Button2"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:text="Button"/>
<Button
android:id="@+id/Button3"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:layout_column="1"
android:layout_row="1"
android:text="Button"/>
<Button
android:id="@+id/Button4"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:layout_column="0"
android:layout_row="1"
android:text="Button"/>
</GridLayout>
</ScrollView>
私はこの問題は、各次の2行であると思いますボタン
android:layout_width="100dp"
android:layout_height="100dp"
「fill_parent」に設定すると、ボタンが画面からずれることがあります。
どうすればこの問題を解決できますか? 私は正しいコードを表示してください。私の英語はとても悪く、私はAndroid Studioで初めてです。