简体   繁体   中英

How to show navigation bar in Interface Builder preview storyboard (assistant editor)

I am doing autolayout works in Storyboard and previewing the result in Assistant Editor > Preview

How can I show navigation bar in the preview?

Take a dummy view and give its height equals to the navigation bar height. (navigation bar height remain same in each device). when u done ur pixel perfection than uncheck installed from attribute inspector of that view or just remove the view.

I suggest another way - just use top constraint, while you container view will have y = 0, you can set top constraint to 44px, in this case you will see warning, but all stuff at your screen will be at the same positions, but preview will display your screen like you have navigation bar. When everything is ok, just set top constraint to 0. I guess this solution is really convenient.

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