调整 Android 日期选择器控件的大小
如何将 android datepicker 控件的初始大小调整为更小或更大。有没有唯一的方法可以重新实现它?
How can one resize the initial size of android datepicker control to be smaller or bigger. Is there only way to reimplement it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我一直无法找到调整其大小的方法,但已经看到了使用 DatePicker 作为对话框的实现。日期呈现为带有编辑按钮的 TextView,该按钮可启动 DatePicker 对话框。它在不编辑时节省屏幕空间...
http://developer. android.com/resources/tutorials/views/hello-datepicker.html
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
要调整日期选择器的大小,请转到 xml 并将
android:scaleX
和android:scaleY
添加到您需要的适当大小。To resize the datepicker go the xml and and add
android:scaleX
andandroid:scaleY
to the appropriate size you need.尝试在受限容器内使用权重总和(例如通过屏幕尺寸或强制填充)。
我已经在另一个线程中发布了它对我来说效果如何
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
添加:
到您的 XML 并更改
DatePicker
的大小Add:
to your XML and change the size of
DatePicker