Tuesday, 15 July 2014

ios - UITextfield UIDatePicker inputView very dark -



ios - UITextfield UIDatePicker inputView very dark -

i have uitextfield needs show uidatepicker uitoolbar in above close it. set uidatepicker textfield's inputview, , uitoolbar inputaccessoryview.

this works fine, default weird color effects. inputaccessoryview translucent 1 expect ios7, inputview appears have black background behind made translucent. leaves inputview much grayer when background color set same in inputaccessoryview.

here code:

- (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. uidatepicker *datepicker = [[uidatepicker alloc] init]; datepicker.backgroundcolor = [uicolor clearcolor]; [self.sometextfield setinputview:datepicker]; uitoolbar *pickertoolbar = [[uitoolbar alloc] init]; pickertoolbar.backgroundcolor = [uicolor clearcolor]; uibarbuttonitem *donebutton = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemdone target:self action:nil]; pickertoolbar.items = @[donebutton]; [pickertoolbar sizetofit]; self.sometextfield.inputaccessoryview = pickertoolbar; }

this results in image (with main view's background colors set in interfacebuilder):

you can see reddish , greenish showing through both, uidatepicker much darker.

if alter both clearcolor whitecolor, this:

here can see inputaccessoryview still translucent (though less so), inputview pure white. if translucent lot less, , can't see anymore.

how can create them both transparent? is, hard without making both exclusively opaque. want maintain them translucent follow ios7 guidelines, not if give me muddy dark version in first screenshot.

ios objective-c ios7 uitextfield uicolor

No comments:

Post a Comment