ios - Can you set the scroll view insets for container controllers? -
ios - Can you set the scroll view insets for container controllers? -
i have container controller displays bar of info right below lop layout guide.
i want kid controller of container controller able scroll behind bar navigation bar , status bar. seems when uikit automatically adjusts scroll view insets of controller takes business relationship length of top layout guide.
is there way scroll view insets should top layout guide + height of bar? know people going suggest set automaticallyadjustsscrollviewinsets = no
have tried this. problem cannot seem replicate when uikit sets content insets , sorts of weird border cases break insets. prominent illustration beingness uitableviewcontroller where, because set content insets manually, refresh command not in right position , when end refreshing insets of scroll view set { 0, 0 } content hidden behind bar , navigation bar.
update: magic seems within methods _setnavigationcontrollercontentinsetadjustment
on uiviewcontroller , _computeandapplyscrollcontentinsetdeltaforviewcontroller
on uinavigationcontroller.
it appears navigation controller attempts adjust scroll view insets , calculates insets based on top , bottom layout guides. passes these insets onto view controller adds/subtracts insets scroll view , takes consideration navigation content insets have been set previously. ensures if else modified content insets between , when navigation controller lastly modified insets not override intermediary changes.
my solution set automaticallyadjustsscrollviewinsets = no
, handle setting of content insets myself.
i created category on uiviewcontroller tracked existing insets set whenever adjusted insets have scroll view appear below custom uiview not losing information, such content inset uitableviewcontroller active refresh command within it.
after lastly challenge figuring out set custom insets , after much experimenting found - (void)viewdidlayoutsubviews
best place it.
fdscrollingtabbarcontroller container controller implemented solution in.
ios uiscrollview uikit
Comments
Post a Comment