Resize android datepicker control

穿精又带淫゛_ 提交于 2019-12-07 01:45:15

问题


How can one resize the initial size of android datepicker control to be smaller or bigger. Is there only way to reimplement it?


回答1:


I haven't been able to figure out a way to resize it, but have seen implementations where they utilize the DatePicker as a dialog. The date is rendered as TextView with an edit button, which launches the DatePicker dialog. It saves screen real estate when not editing...

http://developer.android.com/resources/tutorials/views/hello-datepicker.html




回答2:


To resize the datepicker go the xml and and add android:scaleX and android:scaleY to the appropriate size you need.




回答3:


Try playing with weight sum inside a restricted container (such as by the screen size or forced padding). I've posted in another thread how did it work for me quite well




回答4:


Add:

android:scaleX=""
android:scaleY=""

to your XML and change the size of DatePicker



来源:https://stackoverflow.com/questions/3259720/resize-android-datepicker-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!