What is autoresizesForKeyboard and how does it work? - iphone

I was trying to find a way to adjust my screen when keyboard slides up so that the text field being edited (UITextView in my case) slides up and stays in focus instead of getting hidden behind the keyboard.
I saw a few discussion on google groups mentioning - autoresizesForKeyboard -
http://groups.google.com/group/three20/browse_thread/thread/38bdadc89a1f35f8/2f8b92a6058cf136?lnk=raot&pli=1
I was not able to figure out how to use it or find any documentation for it.
Then I saw how Apple recommends to do it -
http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html
However autoresizesForKeyboard sounds too intriguingly simple. Can someone please shed some light on this?

autoresizesForKeyboard is part of the Three20 library and is a property of the TTViewController class.
http://api.three20.info/interface_t_t_view_controller.html#acc0ff2c5d115eb977aaac419cb64f62b
"Three20 is an iPhone development library. It's the code that powers the Facebook iPhone app and many other apps in the app store."
http://three20.info/

Related

official alternative to implement Splitview as a subview for an IPad App?

I'm developing an app in IOS using Storyboard for the Ipad. I want to add UISplitViewController as a subview of my app. I want to generate this kind of output (see below image). when user click on FirstView's 'Next' button, a second view-splitview should appear.
Output:
But Apple's guidelines says that we can't push UISplitViewController as a subview of module. if we use a UISplitViewController, it has to be visible at all the times in our app.
so
when i tried to add any splitviewcontroller directly into the storyboard, it generated the error .
Split View Controllers cannot be pushed to a Navigation Controller
I dig around the net but unfortunately couldn't find any proper help.
is there any official alternative to use such a kind of facility by Apple itself?
or any link to the working code or samples to implement such a kind of functionality.
If i'm using third party solution, will my app get banned by Apple App store as they don't allow to do so?
I think this is a very basic kind of functionality which many people needs to implement in their app as a submodule. So there must be a inbuilt facility by apple. may b i don't know about it.
any help would be greatly appreciated.
This isn't an answer to your exact question, but may help in part.
I have an app that uses a UISplitViewController that is a subview of a UITabBarController.
This goes against Apple guidelines, but was desirable for my design that started originally as an iPhone app, and that I wanted to convert to a Universal app. I also wanted to maintain the UI convention of my app that the iPhone users were familiar with.
Unsurprisingly, there were problems with the notification of the orientation to the various UISplitViewControllers that weren't visible (though it would seem that Apple could support this if they chose to).
The workaround was to use the new API added in iOS 5.0,
splitViewController:shouldHideViewController:inOrientation:
...and always return NO. Not the ideal UI arrangement, but it works, and was accepted by Apple as an app update.
So, (clearly) you'll need to do this programmatically, rather than use Storyboards, but I think if you can get it working, Apple may approve. I wouldn't recommend you risk this if you can avoid it, however.

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 - 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?
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.
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

What is the name of the UIView used at the "home" screen of iPhone?

First of all, the question is very simple, but I have tried to look around on the Internet and I couldn't find a name for this. Several applications such as "Ping Lite" have used this view in their application. It allows you to have submodules/applications as icons and you can scroll the page around just like when you are at "home" screen.
Can somebody tells me what is the name of the class that is used there?
This kind of view is not available in the iPhone SDK. It is written by Apple and it's not included in the UIKit framework. It's only available in SpringBoard.app, the application responsible for many features of the OS (kind of Finder.app).
However, you can write it yourself of course, using a UIScrollView. This will take some time but luckily we have the Three20 project, which implements the TTLauncherView class
AFAIK the standard sdk has no such a class. You can check third-party libraries(three20, for example) or customize UIScrollView behaviour
The UIView used at the “home” screen of iPhone is a UIScrollView alongwith UIPageControl.
Check the PageControl sample code from Apple and you will learn how it works.