ios - UIView in UINavigationItem doesn't respond to touches -
so, have uinavigationcontroller
embedded in uitabcarcontroller
@ index 1
. on viewcontroller
add uisearchbar
uinavigationitem
. so, works expected. however, need navigate new viewcontroller
navigates new instance of embedded vc.
the flow looks this:
vc 1 -> vc2 -> v1(new instance)
so, vc1
has uinavigationcontroller
embedded in it.
now, issue uiview
added uinavigationitem
not respond touches anymore, yet visible. i've figured has view heir-achy .
what have tried:
- removing , reading uisearchbar each time
vc1
's viewwill/did disappear methods called. - adding
uisearchbar
subview onuinavigationbar
only. - setting uisearchbar using
self.parentviewcontroller...
- bringing uisearchbar front using
uiview's bringsubviewstofront
method.
these either don't solve problem or present few 1 uisearchbar
not appear @ all.
if set uisearchbar
part of uitableview
's headerview
problem disappears falls outside of ui design requirements, not option.
so far way can solve issue changing flow of vcs
. instead of vc2 going new instance of vc1, instead, pop vc2
off stack no animation , required work needed in vc1 (existing instance). whilst works fine, think might odd user wouldn't able swipe vc2
select different option vc1 preform work on. they'd need go vc2
through original invocation of it.
this how add uisearchbar
uinavigationitem
:
self.searchcontroller = [[uisearchcontroller alloc] initwithsearchresultscontroller:nil]; self.navigationitem.titleview = self.searchcontroller.searchbar;
Comments
Post a Comment