[英]How to remove the side padding from the Graphical Style DatePicker in SwiftUI?
As you can see from the screenshot below, the GraphicalDatePickerStyle
date picker by default comes with a side padding on both sides.从下面的屏幕截图中可以看出,默认情况下,
GraphicalDatePickerStyle
日期选择器在两侧都有一个侧边距。 How to remove the side padding so that the control can align with other controls on the top and bottom.如何移除侧边距,以便控件可以与顶部和底部的其他控件对齐。
Add a padding 0 modifier does not change anything.添加 padding 0 修饰符不会改变任何东西。 One workaround would be to add some offset to the control but we just want to be certain there is no better choice.
一种解决方法是向控件添加一些偏移量,但我们只想确定没有更好的选择。
DatePicker("", selection: $actionNotificationTime, displayedComponents: .hourAndMinute)
.padding(0)
The same picker inside Settings is perfectly aligned设置中的相同选择器完全对齐
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.