[Android] ScrollView 안에 ConstraintLayout 을 넣고, 그 안에 TableLayout을 넣은 샘플

By | 12월 29, 2020

 

<ScrollView 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_height="fill_parent"
    android:layout_width="fill_parent" >
<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:tag="buttonParent"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:layout_editor_absoluteY="81dp"
    tools:layout_editor_absoluteX="0dp">
    <!-- ConstraintLayout 안에 TableLayout을 넣어 보았다 -->
    <TableLayout
        android:id="@+id/tableLayout1"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:layout_marginTop="10dp">
        <TableRow
            android:id="@+id/tableRow1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:padding="5dip">
            <TextView
                style="@style/FormLabel02"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_gravity="center_vertical"
                android:layout_weight="3"
                android:gravity="center_vertical|end"
                android:text="호출 서버 : " />
            <RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/rgSvr"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_weight="7"
                >
                <RadioButton
                    style="@style/FormLabel02"
                    android:id="@+id/radioSvr_TEST"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="테스트서버"
                    android:onClick="onRadioSvrClicked"/>
                <RadioButton android:id="@+id/radioSvr_PRD"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="운영서버"
                    android:onClick="onRadioSvrClicked"/>
            </RadioGroup>
        </TableRow>
        <TableRow
            android:id="@+id/tableRow2"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:padding="5dip">
            <TextView
                style="@style/FormLabel02"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="3"
                android:gravity="center_vertical|end"
                android:longClickable="true"
                android:textIsSelectable="true"
                android:text="App Key : " />
            <EditText
                style="@style/FormValue02"
                android:id="@+id/etAppKey"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="7"
                android:textSize="16dp" />
        </TableRow>
    </TableLayout>
    <TextView
        android:id="@+id/textView2"
        android:layout_width="317dp"
        android:layout_height="37dp"
        android:layout_marginEnd="5dp"
        android:layout_marginRight="5dp"
        android:text="블라블라"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/tableLayout1" />
    <Button
        android:id="@+id/btnRemoveSession"
        style="@style/Button03"
        android:layout_width="230dp"
        android:layout_height="40dp"
        android:layout_marginBottom="20dp"
        android:layout_marginTop="10dp"
        android:text="어쩌구저쩌구버튼"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/btnSaveSettings"
        app:layout_constraintVertical_bias="0.0" />
</android.support.constraint.ConstraintLayout>
</ScrollView>

 

 

 

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments