ios - Subview isn't positioned correctly -


i adding uidatepicker uiviewcontroller, rootview of uinavigationcontroller, , use code position datepicker @ bottom of screen.

uidatepicker *picker = [[uidatepicker alloc] initwithframe:cgrectmake(0, self.view.frame.size.height - 216, 320, 216)]; [self.view addsubview:picker]; 

this should place picker @ bottom of screen, 44p missplaced. navigationbar 44p heigh, think problem, don't know why frame height includes height of navbar, when doesn't act subview.

i know simple way substract 44, looking solution without fixed numbers. there way implement , can please explain me why view includes height of navbar?

set translucent property of navigation bar yes solve problem..

ex:

self.navigationcontrollerinstance.navigationbar.translucent = yes; 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -