How I can create something like this:
Because UIActionSheet has only text
- (NSInteger)addButtonWithTitle:(NSString *)title;
You need to use a UIActivityViewController
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIActivityViewController_Class/Reference/Reference.html
If you require more than what it provides, you'll need to create your own UIView
Related
Seeing as the blue doesn't go with my UI interface, im just wondering if there is a way to change the colour of the uialertview, or use a image instead. With all the buttons, 'dismiss' etc still there
Thanks
The fine folks at CodeCropper just put out an open-source control that lets you create custom alert views. It's awesome.
https://github.com/gpambrozio/BlockAlertsAnd-ActionSheets
You could try presenting a Modal View Controller with a transparent background.
ModalViewController *popupController = [[ModalViewController alloc] initWithNibName:#"ModalViewController" bundle:nil];
[self presentModalViewController:popupController animated:NO];
Something like this for the ModalView (http://stackoverflow.com/questions/849458/transparent-modal-view-on-navigation-controller)
This way you can create a custom Alert, but it's really a modal view that you can customize
You can either go through its subviews and change what you need to change, or subclass it. Because UIAlertView inherits from UIView you can use:
myAlertView.subViews
and modify the views or subclass UIAlertView to create your custom AlertView. Here is a very good article on how to sublass UIAlertView to get whatever design/color you want.
Subclassing UIAlertView
Basically what you want to override is this method:
- (void) drawRect:(CGRect)rect
Hope that helps.
you can use a uiview instead of uialertview and can easily customize uiview according to your needs
You could use CODialog. It's fully style-able and configurable.
Subclassing UIAlertView is not an option, this class is not intended to be subclassed and doing so might be a reason of app rejection.
Instead, you might try to go through all alert view's subviews or create your own class
In case you are going to create your own class, here's an example of how to fake UIAlertView:
http://iosdevtricks.blogspot.com/2013/04/creating-custom-alert-view-for-iphone.html
If looking for custom alert view then it might help.
https://github.com/Pradeepkn/PKCustomAlertView/
Hope it helps some one.
No need of setting delegate. You will get call back once the action completes on same method.
Enjoy :)
Custom Alert view
Table Alert view
probably a very simple question but can't find the right answer anywhere. I am using XCode 4 and working on an iphone app, which probably sums up all the info that I need to provide.
Here it is:
- I created a ViewBasedApplication
- At some point depending on the user input, I load a TableView
But now how on Earth do I add a button or something to return? Note: I can't use a NavigationBased app, that would be easier but would not work for me.
Help anyone?
If you used a UITableViewController, you may want to use a UIViewController instead. In the UIVeiwController, you can add a UITableView along with your own UINavigationBar or, if you don't want to use a UINavigationBar, you could leave room for some type of custom UIButton. Either the UINavigationBar button or your custom UIButton action could trigger a close of your UIViewController.
If you add the UIViewController as a subview, then Cyprian's [self removeFromSuperView]; would work. If you present as a modal as Jamie suggests, you could use [self dismissModalViewControllerAnimated:YES];.
Well I don't know you code but you could always call
[self removeFromSuperView];
I read the post Add UIPickerView & a Button in Action sheet - How?
I want to add data to the uipicker view from nsarray , specially I have two buttons that they will call different two uipickerview , so I cannot use the delegate of uipickerview
also what is the code to clise this uipickerview
any suggestion please
– pickerView:titleForRow:forComponent:
If you use that method you are acctually being passed the appropriate pickerview... so you can work out what pickerview you are dealing with from that. Its the same with most of the other delegate methods. So use that to work out what picker view you are dealing with and change the content accordingly.
To get rid of the actionsheet you can do:
[actionSheet dismissWithClickedButtonIndex:0 animated:YES];
is it possible to set a locale for the app with no regard to the users language? My motivation is that I don't want the automatically translated labels of some buttons.
Sincerely,
Heinrich
Create the buttons with UIBarButton's
- (id)initWithTitle:(NSString *)title style:(UIBarButtonItemStyle)style target:(id)target action:(SEL)action
And define your own title / style to create your buttons.
If you don't want certain buttons to appear in the user's language, then do not translate the button into that language.
I have a simple iphone app that's based on the CrashLanding sample app. So basically you tap the title screen and do some stuff... all on the same "view". I want to add an "options" screen/page/view whatever with a few UISwitches. What's the easiest way to do this?
Cheers!
There are numerous examples that show how to manage multiple full-screen views -- each view should typically be managed by a separate view controller. Check the Xcode templates for an example of how you can set up a "flip" view.
Dunno if this will help I'm a bit new to objective-c and iPhone api.
Maybe u can do something like this:
Use the interface builder: just type "Interface Builder" on the Spotlight (top right corner) to generate like "myOptions.xib"
And then just implement it: like
#implementation myOptions
-(void)awakeFromNib
{
...
You can take a look at the QuartzDemo under the iPhone API to see how to load the interface list of objects. In the previous view controller you just need to add it to the object list.
It will look something like this:
#implementation previousController
-(void)awakeFromNib
{
menuList = [[NSMutableArray alloc] init];
QuartzViewController *controller;
controller = [[QuartzViewController alloc] initWithTitle:#"Options"];
controller.quartzViewDelegate = [[[myOptions alloc] init] autorelease];
[menuList addObject:controller];
[controller release];
Hope it helps
Use the Interface Builder to open MainWindow.xib. Add a new View to the XIB. Refer to the Interface Builder User Guide for more details.
http://developer.apple.com/documentation/DeveloperTools/InterfaceBuilder-date.html#doclist
While everyone has mentioned ways and pointers for displaying an additional view, if you are trying to solve your original problem of displaying application settings, you may want to use a settings bundle instead as per the Apple HIG for the iPhone
http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/MobileHIG/HandleTasks/chapter_6_section_4.html#//apple_ref/doc/uid/TP40006556-CH16-SW4
For how to do this, see this:
http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ApplicationSettings/chapter_12_section_1.html#//apple_ref/doc/uid/TP40007072-CH13-SW10