Reputation: 2370
I added UIDatePicker to the UI and gave proper leading and trailing margins. Somehow, a part of W in Wednesday and part of M in Monday are getting cut.
Attached images. I tried increasing and decreasing leading distance from superview but no luck. Can anyone please point me in the right direction?
Upvotes: 2
Views: 617
Reputation: 10336
Unfortunately UIDatePicker does not handle change of the width properly and it always cut Wed and Mon words if the width is less than 320. If you really need to make the width lower than 320 you can solve this with CGAffineTransform. You need to keep the width set to 320 and use transform property to change the scale of the view:
self.transform = CGAffineTransformMakeScale(280.0 / 320.0, 280.0 / 320.0);
This will make the UIDatePicker smaller and it won't cut anything.
Upvotes: 1
Reputation: 9503
If we talk about Date Picker, whenever the date with Mon/Wed is selected it is does not get proper space to show the complete info of that particular date. I just try the something with DatePicker.
Suggestion for your problem : Give DatePicker appropriate width otherwise it behaves like this always.
Upvotes: 1