ios - Using Modal View Controller with UITabBarController and UINavigationBar -
my application embedded within uitabbarcontroller
, has 4 tabs. 3 of 4 tabs embedded within uinavigationcontrollers
, other not.
i have found if viewcontroller
has navigationbar
, using present view controller modally
when segueing, , presenting controller has define context
selected modal view appears underneath both navigationbar
, uitabbar
. if define context
is not selected modal view displayed above uinavigationbar
still underneath uitabbar
. so,
the problem here because modal view controller
presented underneath uitabbar
user can still access uitabbar
, change tabs before dismissing results in black screen.
however if presenting view controller
has not got uinavigationbar
, has not got define context
selected modal view controller
take whole view , displayed above uitabbar
. means user cannot switch tabs before dismissing modal view. intended effect after, how can achieve when using uinavigationbar
user cannot switch tabs ?
if you've created segue in storyboard, select segue modal want presented on everything, , set presentation
attribute over full screen
:
if you're presenting modal programmatically, assuming named view present yourmodal
set modalpresentationstyle
such:
yourmodal.modalpresentationstyle = .overfullscreen
Comments
Post a Comment