0

I am using this control from github Control Used https://github.com/aaronpang/SecretViewer

I have added to subviews
1) For name
2) and added two buttons

Basically i have added to backgroundScrollView.

[_backgroundScrollView addSubview:_segmentedButtonsView];

I have tried to decrease _backgroundScrollView content size.

When i add UINavigationController as root Controller and want to attach just at the top of tableView as per below pics, Bounce effect should remain as per the example.

enter image description here

But when i scroll subview should not move as per below pics.

enter image description here


Note: I am using Storyboard and ios 7

bhavya kothari
  • 7,484
  • 4
  • 27
  • 53

4 Answers4

0

I think you should limit scrollviews' subviews to only a single "content" view, and embed the rest as this content view's subviews.

Rivera
  • 10,792
  • 3
  • 58
  • 102
0

I'm a little unsure of what you're trying to achieve, but I think you want the subviews to stay fixed above the scrollView? I would try adding first to the _backgroundScrollView's superview like so:

[_backgroundScrollView.superview addSubview:_segmentedButtonsView];

If that doesn't work try adding it to the AppDelegate's window like so:

AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[[appDelegate window] addSubview:_segmentedButtonsView];

With the second option, you will have to remove the subviews manually on dismissal of your scrollView. Hope this helps!

rymagno
  • 458
  • 2
  • 9
0

Why don't you add this view to the UINavigationController, as Described here:

How to put buttons over UITableView which won't scroll with table in iOS

Community
  • 1
  • 1
Yossi
  • 2,525
  • 2
  • 21
  • 24
0

Your question is a bit unclear. From what I understand you don't want the scrollview to scroll or bounce horizontally right ??

For ScrollView you can use alwaysBounceVertical = YES; for blocking the horizontal scrolling.

Also this can be scrollView inset issue which is common for iOS7 navigation controller, which you can check here. To solve this you can try setting self.automaticallyAdjustsScrollViewInsets = NO

Hope this helps you.

Community
  • 1
  • 1
Ganesh Somani
  • 2,280
  • 2
  • 28
  • 37