iPhone, Stylish Buttons? - iphone

I am trying to work out (or find) a button that looks half decent for use in my app. In the image below I have two buttons at the bottom, the default button (interfaceBuilder) and one using two png images from the Apple UICatalog.
I am a little shocked that apple did not include something a little more stylish in IB. I assume that my only option is to find/use/make a suitable replacement button image. Before I fire up Photoshop does anyone know of any replacement buttons I might use?
gary

What you can do is use a segmented control with just one segment - you get the shading you want and it's not much harder to use than a standard button.

If you want to try out some button designs, you can draw them in Opacity, which includes a template for iPhone buttons. Opacity can output the button as a stretchable PNG for use in the button or as a UIView / UIButton subclass with all the Quartz drawing calls within it.

I recommend having a look into the Three20 library. It provides a TTButton class that can be customized using TTStyles, and its very easy to create your own styles. In the Three20 example app, there are a lot of styles available already, especially styles for navigation bar buttons. They serve as great examples.

Related

How to use the loading black screen control in ios?

I'm not asking for the full implementation here.
I'm asking because I don't even know what it is called, if somebody could at least tell me the
class I can work with that.
thanks
There is no built-in class for this. However, it can be accomplished using a UIWindow and some views. You should browse http://cocoacontrols.com, they have quite a few open-source versions of this.
For example:
MBProgressHUD: https://www.cocoacontrols.com/controls/mbprogresshud
DejalActivityView: https://www.cocoacontrols.com/controls/dejalactivityview
MMProgressHUD: https://github.com/mutualmobile/MMProgressHUD
It's just a partly transparent UIView with black background and a corner radius of about 15, containing an activity indicator and a label. You can create it in a .xib for easy layout and then load it as needed.

Swiping through a stack of images?

I recently came across this app, tinder, which has a really cool functionality.
You start off with X images. User can swipe left or right to go through each image to signal whether the user likes or dislikes something.
An image can be seen here:
I have been looking at UICollectionView to do this, but I am a little confused about the custom layout I should be using.
I have been thinking of generating a bunch of cells and then setting different z-index and stacking them on top of one another with the same frame.x.
Any tutorial/advise/help available?
This is simple UIImageviews. and tinder only showing two top images and set a background frame just like facebook image gallery.
When you swipe top image current thread fire next image and it replace current image with new image. And you can add like, comment views as you want.
This sounded like fun, so I built an open-source library that mimics the interface you described.
https://github.com/modocache/MDCSwipeToChoose
The sample app included in the project is nearly identical to the UI in your screenshot.

Customize UI with UIWebView vs Subclassing

I need to create a custom button, custom label, custom tableview, and custom datepicker, but it seems harder to subclass the button/label/table/datepicker than to create a HTML string inside a UIWebView and customize it there... My application would be full Objective-c except these 4 controls.
What does Apple say about customizing a control using UIWebview. Is it frowned upon?
What are pro & cons for these 2 approaches?
Should I take a quick HTML, but it feels like I'm cheating, or take a long process to subclass these controls? More importantly, will Apple approve my apps with controls that's using UIWebView?
Thanks.
I'm sure Apple would approve an app with HTML controls, but I'd strongly advise you do it right and subclass the controls you wish to customise (or create your own from scratch). In my experience, native controls are leaps and bounds above what you can achieve with HTML and CSS, and it'll be worth it in the long run.
Besides, UILabels, UIButtons, and UITableViews are actually quite easy to customise; you may have some difficulty with the UIDatePicker but it's still possible to make it your own.
Ok, just in case somebody is having the same problem as me, I finally found another easy way to "customize" the view without going into so much trouble subclassing it..
It's : Use an image to be used as the view background. Then you can place the controls in the placeholder in the image. And set the controls as transparent...

How to set UIButton type?

A small - little question.
I have seen many application having buttons like following.
While using Interface builder I didn't Found any option to have this kind of button.
How to have this kind of button in your application.
See UICatalog example -> Buttons. You will find there this kind of buttons. Usually they're done using png images for pressed & normal states. I think you can do it in IB by binding a png image to pressed & normal states, but the example in UICatalog is pretty clear and can be used "as is"
Almost invariably these styles are done using bitmap images or for the more thrifty of memory, CAGradientLayer.
To do it with CAGradientLayer, you would do something very much like the way the gradient and shadows are done in this blog entry.

iPhone: add badge to icons internal to my app

I am trying to add badges to the icons in my app. e.g. in the facebook app, in the home page the number of pending requests is shown on the requests icon.
Can someone provide any links/ideas on how to do this?
Thanks,
V
I know this article is a little bit old, but it helps me recently to make a little class to create custom badges. I thought it would be fair to make this class public for everyone. So here it is CustomBadge.
best regard
- Sascha
Lots of ways to do this. You can overlay a UILabel over the icon (which may be a UIView or UIImageView). YOu can put another view on top of the icon, and draw the text right into that view. Or make your icon view be a subclass of UIView, and when you get called to draw, you draw the icon and the number.
Plus, you may want to play with blend modes, shadow, masking, etc., in order to create something that is visually attractive.
I'd probably start with reading more about Quartz, if you haven't already. The rest is just how you wire it all up.
And some other links:
http://scientificninja.com/development/numeric-badges-on-the-iphone
http://th30z.netsons.org/2009/03/qt4-drawing-notification-badges/
alt text http://th30z.netsons.org/wp-content/uploads/qtdrawbadges.png
The Three20 project (its code is part of the Facebook app) has those badges.