그래서 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>
글쎄요, 우선 모든 사람들이 거의 모든 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] 삭제
몇 마디 만하겠습니다