• 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
Re: Create resizing Views
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Create resizing Views


  • Subject: Re: Create resizing Views
  • From: Shawn Erickson <email@hidden>
  • Date: Wed, 28 Jan 2004 09:14:49 -0800

On Jan 28, 2004, at 8:19 AM, email@hidden wrote:

How can I create Resizing Views?

Like iTunes (Source, album image) that can resize the various parts?

Umm... basically the view system in Cocoa already supports this capability. Just read some of the documentation on it.

<http://developer.apple.com/documentation/Cocoa/Conceptual/DrawViews/ index.html>

Also Interface Build has great support for this via the springs/struts configuration widget on the found on the "Size" panel on the object inspector (Info panel).

<http://developer.apple.com/documentation/DeveloperTools/Conceptual/ IBTips/IBTips.html>

From the IB FAQ...

 How do I set up the springs and struts so my views autosize?
Views can be made to resize automatically when the window or split view that contains them is resized. You will probably need to set the springs and struts for every view in your window. The easiest way to see how they work is to assign a few views with different settings and then use File > Test Interface to see the results. To see how this works, bring up the Size info panel and select a square bevel button. There are two parts to Cocoas auto sizing: growing and anchoring. How the button grows is determined by the strut/spring setting shown inside the button picture in the info panel. If an axis (horizontal or vertical) is a spring, then the view can grow when its container is resized. If its not a spring, but rather a strut, the button will remain the same size. Click on the horizontal axis inside the mock button to turn it into a curly spring. Then use the menu item File > Test Interface to test the interface. Grow the window in various directions. The button gets longer, but never taller or shorter. Click the switch icon in the menu bar or press Command-Q to stop testing the interface. Repeat this process, but with the vertical axis set as a spring. Now it can get taller or shorter but never wider. The outer set of springs and struts represents how the view is to be anchored. If a segment is a strut, the view maintains a constant distance to the side of its container along that side. However, if its a spring the view allows the distance to vary. Select the sample square bevel button and click the left-most segment so that it turns into a spring. Because the segment at right is still a strut, the view maintains a constant distance to the edge of the window from the views right side, but allows a variable distance along the left side. Test the interface to see the effect.

-Shawn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Create resizing Views (From: email@hidden)

  • Prev by Date: reading postscript file
  • Next by Date: Re: List of Images like in System Preferences + General NSMatrix issue
  • Previous by thread: Create resizing Views
  • Next by thread: Re: Create resizing Views
  • Index(es):
    • Date
    • Thread