How do I change the tint color (background) of a UIActionSheet in iOS5? - iphone

I would like to change the tint color of my UIActionSheet for my iOS apps. Is there an easy answer or custom class which I can use to achieve this?
I have found help on changing the colors of the Action Sheet buttons which is helpful, but I haven't found anything about changing the background color.

There is no API, but you could subclass UIActionSheet and play around with its subviews array till you find the one that draws the background and either edit it directly, or add a subview to cover it up.
While this isn't the greatest approach, it isn't using any hidden APIs to it won't get rejected from the iTunes store. Before iOS 5, this is how most customization was done.
Here is a great example of doing it with Navbars.

I am not able to respond to the above comments. However the link provided by #Luke is broken, but I have found it to be active here: https://github.com/gpambrozio/BlockAlertsAnd-ActionSheets

There is no legal API for this, and if you use illegal API your app will be rejected from the app store. The simplest solution is to roll your own interface and not use UIActionSheet.

Related

iOS ambient notifications in status bar like new Twitter app

I am trying to recreate the same in app notifications that the new twitter app has, they call them Ambient Notifications. I've search through apples documentation for both iOS 5 and 6, but I haven't found anything useful, or even relevant. If someone has done this before and could give me an example? I can work off that. Thanks.
I am also searching for same as my client want same functionality in our app but still no luck.but meanwhile you can use this library to achieve your goal https://github.com/brunow/BWStatusBarOverlay
If you just want to show a notification in the iOS Status Bar, I would advise you to use CWStatusBarNotification, which can be added to your Xcode project using Cocoa Pods.
You can set parameters, like the duration, background color, text color, animation style, etc.

Lion style non-modal alert example for iOS

Xcode4 introduced the gray-rounded-square style non-modal alerts that momentarily appear as required. For an example, see 'Build Succeeded'. iirc, this style of non-modal alert is also used elsewhere in Lion.
Now, also iirc, I believe I saw some official iPhone sample code showing how they recommend this effect is achieved in iPhone Apps, but I can't find it again. I'd like to use in my App this to achieve a consistent style.
If someone recalls what I'm talking about, I'd appreciate a link. Thanks.
I think you're talking about the bezel notification style? On iOS, I know SSToolkit has support for such a display (under HUD View).
Another way: This uses MBProgressHUD and provides sample code.
I think you can do it using a momentary UIActivityIndicator. Something like this
EDIT: or this
EDIT: The idea is the same, a custom activity indicator. The above answer gives you some more specific links to your problem. But well it is an activity indicator you're looking for.

iPhone keyboard return key

I need to customize the iphone keyboard. How can I do it? Also it is needed to place the return key of the keyboard with my project logo. How is it possible?
You cannot customize the apple iOS's default keyboard.
As such you can create a custom control similar to apple iOS's keyboard and make it look and customize as you want but then there ar more chances than not that your app may be rejected when you try to submit your app on the Apple's app store.
So it is not preferable to create custom keyboard.
Hope this helps you.
What have we done in one of our apps and you can do is create custom uibutton that is same size as return key, then register for UIKeyboardWillShowNotification and UIKeyboardWillHideNotification.
when one of those fire you should add/remove that uibutton to window with animation that tracks keyboard showing/hiding animation...
Ugly way to do it, but it served its purpose...
Some of the tutorials are incomplete or are much older. This tutorial works from IOS 4.3 onwards and I checked it. Save the two image graphics, and paste in the code. There is very little to change. Here is the link.
ps. I am not affiliated in any way with this article, but found it to be complete.
http://www.neoos.ch/blog/37-uikeyboardtypenumberpad-and-the-missing-return-key

IPhone SDK - How do I implement an Apple like rating UIAlertView?

Does anyone have an Idea how to implement an UIAlertView for rating purpose like Apple show when you are removing an app from the iPhone?
You can choose how many stars to rate the app or don't rate it at all.
I already have a view that shows the stars according to the user touches but don't know how to connect it to the UIAlertView...
Thanks!
A good tutorial how to do this:
http://iphonedevelopment.blogspot.com/2010/05/custom-alert-views.html
I like the TSAlertView. It's a complete replacement of UIAlertView based on UIView. So you don't use any private APIs.
I used it in multiple projects and I really like it. Take a look at it. With that one it should be easy to add your "starview" to the AlertView becuase you have methods to add a contentView.

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.