2017-10-26 1 views
0

아래와 같이 DialogFragment에 대한 사용자 지정 레이아웃이 DatePicker이고 일부 레이블이 있습니다. 하지만 필자는 화이트 필드를 오른쪽으로 제거 할 수는 없습니다. 또한 캘린더에서 하루를 선택 취소 할 수 있습니까 (초기 날짜가없는 경우)? API (26)DatePicker가있는 사용자 지정 대화 상자의 레이아웃에 문제가 있습니다.

enter image description here

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:orientation="vertical"> 

    <DatePicker 
     android:id="@+id/pickerReminderDate" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:background="@color/Grey300"/> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:textAppearance="?android:textAppearanceSmall" 
     android:padding="@dimen/indent_small" 
     android:background="@color/colorAccent" 
     android:textColor="@color/TextInverse" 
     android:gravity="center_horizontal 
     android:text="@string/dialogDateNote"/> 

</LinearLayout> 

답변

0

부모를 일치하도록 용기있는 LinearLayout의 폭과 높이를 설정합니다. 부모와 일치하도록 날짜 선택 도구 너비를 설정하십시오.

+0

작동하지 않습니다. –

관련 문제