Hi is there any library or special view in cocoa touch which help to create a popup window like when the istore ask you for your password and name?or is it transparent view with image 2 textfields and 2 buttons? I need it because i want to make my login screen similar. thanks
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- back button text does not change
- iOS (objective-c) compression_decode_buffer() retu
- how to find the index position of the ARRAY Where
相关文章
- 现在使用swift开发ios应用好还是swift?
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- didBeginContact:(SKPhysicsContact *)contact not in
- Custom Marker performance iOS, crash with result “
you need to create your own view controller dude
If you want to create a view that looks similar, your best bet is probably to create a UIAlertView subclass. You could create your own subclass and add the required elements.
Create a UIAlertView subclass like this in the header:
As for the implementation of LoginView, please keep in mind the following ...
In order to resize the UIAlertView to fit your contents (buttons, labels), you'd have to set the message text to some amount of empty lines, e.g. you could add 5 empty lines by doing the following on your UIAlertView subclass:
^ Just add buttons and labels like on any other UIView. Create an instance of this view and call the -show method to display the view, e.g.:
To make the LoginView more flexible, create a custom initializer which accepts a target (of type id) and selector (of type SEL). When someone presses the login button, make it use the target and selector to perform the actual login. Or put the login code in the LoginView itself and create a delegate that informs the caller whether a login was successful.
This approach is kind of 'hacky' with the empty line stuff, but the result looks very nice :)
P.S.: remember that when you create a view like this, you shouldn't call -setMessage: on the instance, as it will reset the size (frame) of the view (or override setMessage: on the subclass to prevent resizing). If you need some label to write text on, create your own label and add it as a subview.