2017-08-11 29 views

回答

0

您可以在iOS 10下的UINavigationBar中使用自定義titleView中的AutoLayout,包括iOS 10.
因爲自定義titleView只是UIView。
但是,如果你想調整AutoLayout自定義titleView,就像下面。

UIView *customTitleView; //Assume that is custom titleView on UINavigationItem. 

if (customTitleView.superview != nil) { 
    [customTitleView.superview addConstraint:[NSLayoutConstraint constraintWithItem:customTitleView 
                    attribute:blahblah 
                    relatedBy:blahblah 
                     toItem:customTitleView.superview 
                    attribute:blahblah 
                    multiplier:1.0 
                     constant:0.0]]; 
}