• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Adding fixed position subview over a scrollview
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adding fixed position subview over a scrollview


  • Subject: Adding fixed position subview over a scrollview
  • From: Gideon King <email@hidden>
  • Date: Wed, 31 Mar 2010 16:06:46 +1000

Hi all

I have a scrollview, and I want to add a fixed position subview on top of it so it always displays at the same place relative to the top left of the scrollview, no matter whether the user scrolls the document or resizes etc.

I have tried the following methods, but none of them have left me with the result I want:

...adding my view as a subview of:
- the scrollview
- the scrollview's clipview
- the scrollview's document view
- the scrollview's content view
- the tab view which is the superview of the scrollview
also
- adding a new view as  the tabview item's view, and adding the scrollview and my view as sibling subviews
- making my own scrollview subclass and drawing there.

The results I have achieved so far are:
- nothing shown (probably because the other views get drawn on top of it)
- starts in the right place, but scrolls when the view scrolls
- fixed location on the document, either relative to 0,0 point or the top left corner of the view (which means it scrolls when the content scrolls)

The current view hierarchy is:
- Window content view (can't have it here as it moves around when other views resize)
- RBSplitView (ditto)
- RBSplitSubView (adding it as a subview here makes RBSplitView think it needs to be tiled, or if I hack the RB code for it to ignore my view in the tiling, it somehow ends up as part of the scrollview)
- TabView (adding as a subview here means that the scrollview draws over the top of it)
- ScrollView (adding it as a subview here, or drawing my own custom scrollview means the subviews of the scrollview overwrite it)
- ClipView (adding it here means that it scrolls)
- MyView (adding it here means that it scrolls)

I feel as if I must be missing something obvious...

Any suggestions on how I could get this to work?

Thanks

Gideon



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Adding fixed position subview over a scrollview
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Creating WebView in code
  • Next by Date: Re: Adding fixed position subview over a scrollview
  • Previous by thread: Re: Best way to selectively show objects in a tree controller/outlineview
  • Next by thread: Re: Adding fixed position subview over a scrollview
  • Index(es):
    • Date
    • Thread