1
27x27 GridLayoutをデザインしたいと思います。グリッド内のすべてのセルには1つの文字しか含まれていません。 GridLayoutを可能な限り大きくするために、GridLayoutを画面の上下に(横向きに)拘束します。読みやすさを最適化するために、私はTextViewsで「自動サイズ設定」を使用します。横向きで、「ネクサス10」、「画素C」と「ネクサス9」のエミュレータ上で、このレイアウトが正しく表示さAndroidのメーカー3.0を使用して"autosizing"は小さなTextViewsでは機能しないようです
<?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:id="@+id/SCFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize"
tools:layout_behavior="@string/appbar_scrolling_view_behavior"
>
<android.support.v7.widget.GridLayout
android:id="@+id/SudokuGrid"
android:layout_width="0dp"
android:layout_height="0dp"
android:tag="SudokuGrid"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
>
<android.support.v7.widget.AppCompatTextView
android:id="@+id/A11"
android:gravity="center"
android:text="1"
app:autoSizeMinTextSize="5sp"
app:autoSizeStepGranularity="1sp"
app:autoSizeTextType="uniform"
app:layout_column="0"
app:layout_columnWeight="1"
app:layout_row="0"
app:layout_rowWeight="1" />
<android.support.v7.widget.AppCompatTextView
android:id="@+id/A12"
android:gravity="center"
android:text="2"
app:autoSizeMinTextSize="5sp"
app:autoSizeStepGranularity="1sp"
app:autoSizeTextType="uniform"
app:layout_column="1"
app:layout_columnWeight="1"
app:layout_row="0"
app:layout_rowWeight="1" />
... repeat this for 27 columns and 27 rows in total;
you just need to complete the first line and the first column to be able to reproduce the problem
。しかし、他のすべてのエミュレータでは失敗します。 高さの取り扱いが問題になっているようです。どんな考え?