简体   繁体   中英

UIView's frame origin.y = 0 but displayed at origin.y = statusBarHeight

i have a main view containing 3 subviews and i have a strange behaviour with the last one. I set its frame origin to 0,0 and it appears 20px under the statusBar. To fix the problem i have to set frame.origin.y = -20 . How is it possible? The 2 other views are correctly shown...

How is the problematic view constructed? If it comes from a nib or a storyboard, have a look at the 'simulated metrics' for the appropriate item -- you may have a status bar enabled the view in question. If so, try setting 'None' for the status bar.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM