0
こんにちは、私は2つのチームがあり、それらを横並びにしたいのですが、私はそれをDesignセクションAndroidのスタジオは、彼らが中心に見えていないうっすらと出てきたし、私はボタンがすべて同じサイズでなければならないことも欲しい。ConstrainLayout XMLのガイドライン私のレイアウトはうまく見えません。誰でも私がそれを修正するのを助けることができます
おかげであなたは、このようなTableLayout
使用することができ ジョー
<?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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.android.courtcounter.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Team A"
android:id="@+id/TeamA"
android:paddingTop="36sp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintHorizontal_bias="0.202" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:id="@+id/n0"
android:padding="12dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/TeamA"
app:layout_constraintHorizontal_bias="0.215" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+3 POINTS"
android:id="@+id/points3"
android:layout_margin="8dp"
android:onClick="points3"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/n0"
android:layout_marginTop="7dp"
app:layout_constraintHorizontal_bias="0.127" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+2 POINTS"
android:id="@+id/points2"
android:layout_margin="8dp"
android:onClick="points2"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/points3"
app:layout_constraintHorizontal_bias="0.124" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="FREE THROW"
android:id="@+id/freeThrow"
android:layout_margin="8dp"
android:onClick="freeThrow"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/points2"
android:layout_marginTop="8dp"
app:layout_constraintHorizontal_bias="0.101" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Team B"
android:id="@+id/TeamB"
android:paddingTop="36sp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintHorizontal_bias="0.773"
tools:layout_editor_absoluteY="0dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:id="@+id/n0B"
android:padding="12dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/TeamB"
app:layout_constraintHorizontal_bias="0.761" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+3 POINTS"
android:id="@+id/points3B"
android:layout_margin="8dp"
android:onClick="points3"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/n0B"
android:layout_marginTop="7dp"
app:layout_constraintHorizontal_bias="0.827" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+2 POINTS"
android:id="@+id/points2B"
android:layout_margin="8dp"
android:onClick="points2B"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/points3B"
android:layout_marginTop="8dp"
app:layout_constraintHorizontal_bias="0.81" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="FREE THROW"
android:id="@+id/freeThrowB"
android:layout_margin="8dp"
android:onClick="freeThrow"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/points2B"
app:layout_constraintHorizontal_bias="0.854" />
<android.support.constraint.Guideline
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/guideline4"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5"
tools:layout_editor_absoluteY="0dp"
tools:layout_editor_absoluteX="192dp" />
</android.support.constraint.ConstraintLayout>
こんにちは、おかげで何が閉じ括弧にする必要があります、また私は2つの列、 –
TableLayout>を閉じると、TableRowの子ビューのlayout_marginを設定することで、より多くのスペースを確保できます。 –