简体   繁体   中英

iPhone SDK - Expanding Buttons like in the camera app

I am curious as to whether or not there is an open source solution to replicate the flash button in the iOS camera applicaiton.

I have seem many other apps use this, but there doesn't seem to be a native way, so I assume there is a common source out there.

It is possible to get the flash button by using UIImagePickerController class, but most of the camera apps out there don't seem to be using this (or perhaps they subclass it, which is against apple's terms).

I am looking for a way to replicate the expanding behavior of the button. Any thoughts?

While looking for a similar solution to this problem I came across this code which was extremely helpful. Similar to ExpandyButton it fit my needs better.

https://github.com/ddebin/DDExpandableButton

It doesn't sound too hard.

The way I'd do it is to separate the right curve of the button (as images), and make a UIView that has the left part of the button and the right curve as subviews.

When it's tapped, slide the right curve and animate the extra buttons in.

You could use a stretchable UIImage (see UIImage documentation) and then just animate the frame changing.

In the Apple 2010 WWDC Sample code (downloadable via iTunes, otherwise I'd post it here), there are several sample applications which use this control. They call the class ExpandyButton . I realize I'm answering my question, but hopefully someone out there can find this useful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM