이 레이아웃을 CardView에 넣는 방법은 무엇입니까?

jglom

그래서 1 CardView에 처음 세 개의 Inputlayouts / EditTexts를 표시하려는 레이아웃이 있습니다 ... 아래는 내 XML과 이미지가 올바르게 보입니다.

당신이 나를 도울 수 있기를 바랍니다.

감사합니다 !! :)

이것은 내 레이아웃입니다

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorBackground">

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".activities.MainActivity">

        <LinearLayout
            android:id="@+id/information"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_alignParentTop="true"
            android:orientation="vertical"
            android:padding="16dp">

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="15dp"
                android:gravity="center">

                <android.support.design.widget.TextInputLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <EditText
                        android:id="@+id/field_education_year"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:hint="Ausbildungsjahr"
                        android:inputType="number"
                        android:maxLines="1" />

                </android.support.design.widget.TextInputLayout>

            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="15dp"
                android:gravity="center">

                <android.support.design.widget.TextInputLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:focusableInTouchMode="false">

                    <EditText
                        android:id="@+id/field_week_start"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:focusableInTouchMode="false"
                        android:hint="week start"
                        android:inputType="text|date"
                        android:onClick="onClick" />

                </android.support.design.widget.TextInputLayout>

            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="15dp"
                android:gravity="center">

                <android.support.design.widget.TextInputLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:focusableInTouchMode="false">

                    <EditText
                        android:id="@+id/field_week_end"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:focusableInTouchMode="false"
                        android:hint="week end"
                        android:inputType="text|date"
                        android:onClick="onClick" />

                </android.support.design.widget.TextInputLayout>

            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="15dp"
                android:gravity="center">

                <android.support.design.widget.TextInputLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <EditText
                        android:id="@+id/field_title"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:hint="Title"
                        android:maxLines="1" />

                </android.support.design.widget.TextInputLayout>

            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="15dp"
                android:gravity="center">

                <android.support.design.widget.TextInputLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <EditText
                        android:id="@+id/field_notice"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:hint="Notice"
                        android:inputType="textMultiLine"
                        android:scrollHorizontally="false" />

                </android.support.design.widget.TextInputLayout>
            </RelativeLayout>

            <android.support.design.widget.FloatingActionButton
                android:id="@+id/fab_submit_post"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_centerHorizontal="true"
                android:layout_margin="16dp"
                android:src="@drawable/ic_publish_new_report" />

        </LinearLayout>

    </RelativeLayout>

</android.support.v4.widget.NestedScrollView>
JMedinilla

글쎄요, 우선 모든 사람들이 거의 모든 RelativeLayout것이 쓸모 없다는 데 동의 할 것이라고 생각합니다 . 그들은 말 그대로 아무것도하고 있지 않습니다. 저를 믿으세요. 삭제할 수 있으며 정확히 동일합니다.

즉, 요점으로 이동합시다. 당신은 그 세 개의 EditText내부를 Cardview하지만 CardView에는 하나의 자식 만 포함됩니다. 당신은을 배치해야합니다 CardView로모그래퍼 LinearLayout또는 RelativeLayout다른 그 레이아웃, 모든 내부, 내부합니다.

다음과 같이 :

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorBackground">

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/information"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentTop="true"
    android:orientation="vertical"
    android:padding="16dp"
    tools:context=".activities.MainActivity">

    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="15dp">

                <EditText
                    android:id="@+id/field_education_year"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Ausbildungsjahr"
                    android:inputType="number"
                    android:maxLines="1" />
            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="15dp"
                android:focusableInTouchMode="false">

                <EditText
                    android:id="@+id/field_week_start"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:focusableInTouchMode="false"
                    android:hint="week start"
                    android:inputType="text|date"
                    android:onClick="onClick" />
            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="15dp"
                android:focusableInTouchMode="false">

                <EditText
                    android:id="@+id/field_week_end"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:focusableInTouchMode="false"
                    android:hint="week end"
                    android:inputType="text|date"
                    android:onClick="onClick" />
            </android.support.design.widget.TextInputLayout>
        </LinearLayout>
    </android.support.v7.widget.CardView>

    <android.support.design.widget.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="15dp">

        <EditText
            android:id="@+id/field_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Title"
            android:maxLines="1" />
    </android.support.design.widget.TextInputLayout>

    <android.support.design.widget.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="15dp">

        <EditText
            android:id="@+id/field_notice"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Notice"
            android:inputType="textMultiLine"
            android:scrollHorizontally="false" />
    </android.support.design.widget.TextInputLayout>

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab_submit_post"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_margin="16dp"
        android:src="@drawable/ic_publish_new_report" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Android : 레이아웃을 다른 레이아웃에 '삽입'하는 방법은 무엇입니까?

분류에서Dev

Android에서 그래픽 레이아웃의 레이아웃을 보는 방법은 무엇입니까?

분류에서Dev

다른 레이아웃 위에 레이아웃을 추가하는 방법은 무엇입니까?

분류에서Dev

EditMode에서 레이아웃을 확장하는 방법은 무엇입니까?

분류에서Dev

SWT에서 compoiste 레이아웃을 늘리는 방법은 무엇입니까?

분류에서Dev

Laravel에서 레이아웃을 설정하는 방법은 무엇입니까?

분류에서Dev

Android에서 현재 레이아웃을 얻는 방법은 무엇입니까?

분류에서Dev

Android에서 활성 레이아웃 변경 (레이아웃 A-> 레이아웃 B)을 애니메이션하는 방법은 무엇입니까?

분류에서Dev

패널에서 애플리케이션 아이콘을 레이아웃하는 방법은 무엇입니까?

분류에서Dev

패널에서 애플리케이션 아이콘을 레이아웃하는 방법은 무엇입니까?

분류에서Dev

선형 레이아웃에서 이미지 아이콘을 정렬하는 방법은 무엇입니까?

분류에서Dev

스택 레이아웃에서 레이블 및 입력을 배치하는 방법은 무엇입니까?

분류에서Dev

레이아웃을 만드는 방법은 무엇입니까?

분류에서Dev

Kivy (Python)에서 2 개의 레이아웃을 오버레이하는 방법은 무엇입니까?

분류에서Dev

Ubuntu 우크라이나어 키보드 레이아웃에 "Ґ"을 입력하는 방법은 무엇입니까?

분류에서Dev

자동 레이아웃이 UIButton에 적용될 때 UIBarButton을 이동하는 방법은 무엇입니까?

분류에서Dev

이 명령을 Makefile에 넣는 방법은 무엇입니까?

분류에서Dev

onSwipe 방법에서 키보드 레이아웃을 변경하는 방법은 무엇입니까?

분류에서Dev

navbarpage 레이아웃에 valuebox를 삽입하는 방법은 무엇입니까?

분류에서Dev

Android의 툴바 아래에서 서랍 레이아웃을 시작하는 방법은 무엇입니까?

분류에서Dev

아래 레이아웃에 수직선을 추가하는 방법은 무엇입니까?

분류에서Dev

AngularJS 및 / 또는 AngularJS Material에서이 레이아웃을 개발하는 방법은 무엇입니까?

분류에서Dev

QtDesigner의 속성 프레임에서 레이아웃을 구축하는 방법은 무엇입니까?

분류에서Dev

NUXTJS 페이지에서 레이아웃으로 소품을 설정하는 방법은 무엇입니까?

분류에서Dev

Libgdx : 테이블 레이아웃에서 행 배경을 설정하는 방법은 무엇입니까?

분류에서Dev

Blazor의 페이지에서 레이아웃으로 값을 전달하는 방법은 무엇입니까?

분류에서Dev

Ubuntu에서 "이국적인"키보드 레이아웃을 추가하는 방법은 무엇입니까?

분류에서Dev

div에서 이미지의 2 열 레이아웃을 만드는 방법은 무엇입니까?

분류에서Dev

앱 홈페이지에서 레이아웃을 우회하는 방법은 무엇입니까?

Related 관련 기사

  1. 1

    Android : 레이아웃을 다른 레이아웃에 '삽입'하는 방법은 무엇입니까?

  2. 2

    Android에서 그래픽 레이아웃의 레이아웃을 보는 방법은 무엇입니까?

  3. 3

    다른 레이아웃 위에 레이아웃을 추가하는 방법은 무엇입니까?

  4. 4

    EditMode에서 레이아웃을 확장하는 방법은 무엇입니까?

  5. 5

    SWT에서 compoiste 레이아웃을 늘리는 방법은 무엇입니까?

  6. 6

    Laravel에서 레이아웃을 설정하는 방법은 무엇입니까?

  7. 7

    Android에서 현재 레이아웃을 얻는 방법은 무엇입니까?

  8. 8

    Android에서 활성 레이아웃 변경 (레이아웃 A-> 레이아웃 B)을 애니메이션하는 방법은 무엇입니까?

  9. 9

    패널에서 애플리케이션 아이콘을 레이아웃하는 방법은 무엇입니까?

  10. 10

    패널에서 애플리케이션 아이콘을 레이아웃하는 방법은 무엇입니까?

  11. 11

    선형 레이아웃에서 이미지 아이콘을 정렬하는 방법은 무엇입니까?

  12. 12

    스택 레이아웃에서 레이블 및 입력을 배치하는 방법은 무엇입니까?

  13. 13

    레이아웃을 만드는 방법은 무엇입니까?

  14. 14

    Kivy (Python)에서 2 개의 레이아웃을 오버레이하는 방법은 무엇입니까?

  15. 15

    Ubuntu 우크라이나어 키보드 레이아웃에 "Ґ"을 입력하는 방법은 무엇입니까?

  16. 16

    자동 레이아웃이 UIButton에 적용될 때 UIBarButton을 이동하는 방법은 무엇입니까?

  17. 17

    이 명령을 Makefile에 넣는 방법은 무엇입니까?

  18. 18

    onSwipe 방법에서 키보드 레이아웃을 변경하는 방법은 무엇입니까?

  19. 19

    navbarpage 레이아웃에 valuebox를 삽입하는 방법은 무엇입니까?

  20. 20

    Android의 툴바 아래에서 서랍 레이아웃을 시작하는 방법은 무엇입니까?

  21. 21

    아래 레이아웃에 수직선을 추가하는 방법은 무엇입니까?

  22. 22

    AngularJS 및 / 또는 AngularJS Material에서이 레이아웃을 개발하는 방법은 무엇입니까?

  23. 23

    QtDesigner의 속성 프레임에서 레이아웃을 구축하는 방법은 무엇입니까?

  24. 24

    NUXTJS 페이지에서 레이아웃으로 소품을 설정하는 방법은 무엇입니까?

  25. 25

    Libgdx : 테이블 레이아웃에서 행 배경을 설정하는 방법은 무엇입니까?

  26. 26

    Blazor의 페이지에서 레이아웃으로 값을 전달하는 방법은 무엇입니까?

  27. 27

    Ubuntu에서 "이국적인"키보드 레이아웃을 추가하는 방법은 무엇입니까?

  28. 28

    div에서 이미지의 2 열 레이아웃을 만드는 방법은 무엇입니까?

  29. 29

    앱 홈페이지에서 레이아웃을 우회하는 방법은 무엇입니까?

뜨겁다태그

보관