DatePicker가 캘린더보기로 표시되면이 캘린더보기 하단에 텍스트로 추가 레이블을 붙일 수 있습니까 (그림 참조)? 나는 원래 안드로이드 DatePicker를 사용자 정의 할 가능성이 있는지 찾고 있었지만, 적절한 방법을 찾을 수 없었습니다.Android DatePicker 레이아웃 사용자 정의
0
A
답변
3
당신은 here에서 소스 코드를 얻을 수 있습니다.
원하는대로 레이아웃을 사용자 정의하려면 layout-land/mdtp_date_picker_dialog.xml
및 layout-sw600dp-land/mdtp_date_picker_dialog.xml
필드를 수정해야합니다. 저는 여기에 스크린 샷으로 두 TextViews
을 추가 한 : 당신이 원하는대로 dimens
관련
<?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:background="@color/mdtp_background_color"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="450dp"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:orientation="vertical">
<include layout="@layout/mdtp_date_picker_header_view" />
<include layout="@layout/mdtp_date_picker_selected_date" />
<include layout="@layout/mdtp_date_picker_footer_view" />
<TextView
android:id="@+id/added_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="8dp"
android:text="Some Text" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<include layout="@layout/mdtp_date_picker_view_animator" />
<TextView
android:id="@+id/added_text2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Some text" />
</LinearLayout>
</LinearLayout>
<include layout="@layout/mdtp_done_button" />
</LinearLayout>
변경이 TextViews
를 찾습니다.
0
나는 비슷한 문제에 직면했다. this 라이브러리를 사용하는 것이 좋습니다.
원하는 방식으로이 라이브러리를 사용자 정의 할 수 있습니다. 레이아웃 파일을 편집하고 원하는 특정 레이아웃을 확장하면됩니다. 또한 레이아웃 파일에 쉽게 레이블을 추가 할 수 있습니다.
희망이 있습니다.
관련 문제
- 1. 기본 Android 레이아웃 사용자 정의
- 2. AutoCompleteTextView 레이아웃 사용자 정의 android
- 3. Android 사용자 정의 레이아웃 중력
- 4. 복사 DatePicker 사용자 정의
- 5. iphone 사용자 정의 datepicker
- 6. 사용자 정의 jquery datepicker
- 7. 사용자 정의 DatePicker-iOS
- 8. ActionBar의 Android 용 사용자 정의 레이아웃
- 9. XML 레이아웃 편집기 사용자 정의 Android Eclipse
- 10. Android - 사용자 정의 대화 상자 레이아웃 문제
- 11. android achartengine 사용자 정의 레이아웃 차트 설정
- 12. Android 대화 상자 사용자 정의 레이아웃
- 13. Android 용 사용자 정의 XML 레이아웃
- 14. jQuery datepicker 마크 업 사용자 정의
- 15. XML로 사용자 정의 레이아웃
- 16. jqueryui datepicker 사용자 정의 문제
- 17. jQuery UI datepicker 사용자 정의
- 18. WPF DatePicker 마스크 사용자 정의
- 19. DatePicker 사용자 지정. 안드로이드
- 20. 지도 레이아웃 사용자 정의
- 21. UITableView의 사용자 정의 레이아웃
- 22. ListActivity 레이아웃 사용자 정의
- 23. ListView 사용자 정의 레이아웃
- 24. UICollectionView의 사용자 정의 레이아웃
- 25. 지루한 레이아웃 사용자 정의
- 26. 안드로이드 - 사용자 정의 레이아웃
- 27. UICollectionView 사용자 정의 레이아웃
- 28. 코멘트 레이아웃 사용자 정의
- 29. 사용자 정의 UICollectionView 레이아웃
- 30. 사용자 정의 SherlockActionBar 레이아웃 탭
아직 작업하고 있지만 필요한 것 같습니다. 고맙습니다. – etilia
향후 안드로이드 버전에서 깨지지 않도록 보장되어 있습니까? Android에서 공식 API를 보지 못했습니다. – Dibzmania