Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
Thanks, I copy & pasted your code and it worked fine?!?!?
Use my commented version and it will crash? I must be going cross-eyed. :confused:
I don't see the problem....
I'm gonna bump up your reputation, though. Thanks. Your solution works fine.
I know you're probably finished with this but the only problem with your piece of code was the 'addSubview' you have used a capital 'V' when it should have been lowercase. I haven't been caught out by that one before but typos are generally a pain in my ***!
This works fine for adding an image to an action sheet. but i want to add a label to the action sheet. How should i add the label. Can i have some sample code..
it should also work for labels. What error it gives?
It is not giving any errors but when we dismiss the action sheet the label is not dismissed with the action sheet. The label dismissed after action sheet got dismissed. that is my problem..
Here is some code that adds a green check mark image to an action sheet, centered and with same spacing as the default action sheet. The image is pure decoration - it does not respond to user touches. The code is specific to my application so you will need to adapt it as necessary.
In some method that initiates the display of the action sheet (I'm triggering off of an NSNotification but it could be any method):
The delegate method adds the image and pushes the buttons lower. The buttons are so low, in fact, that you can't see them. Can you point me in the direction of changing the verticle position of the actionsheet so that I can see the image and all the buttons? Thanks again.
Replies
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeThanks
Marco Napoli
http://www.ourlovingmother.org
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeYou can define this method in UIActionSheet deleget:
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet{
UIImageView df = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Someimage.png"]];
[actionSheet addSubView:df];
}
Hope my first post in this forum may come into your helps :)
Expert in Java/Spring/OSGi, iOS app development.
Enthusiastic C/C++, PHP, Cocoa Mac App developer.
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeiPad Apps Blog - Send me a code for your app, and I'll review it
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeYou may also need to update the frame of the image to position at the desired location and need to add "SomePic.png" as the resource :)
Thanks.
Expert in Java/Spring/OSGi, iOS app development.
Enthusiastic C/C++, PHP, Cocoa Mac App developer.
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeLate welcome to the forums, but... welcome to the forums. :)
iPad Apps Blog - Send me a code for your app, and I'll review it
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesome!! do a clean, then build.
Or download the demo app from here, just made for you :)
http://amanpages.com/downloads/ActionSheetTest.zip
http://amanpages.com/downloads/ActionSheetTest.png (SS)
Expert in Java/Spring/OSGi, iOS app development.
Enthusiastic C/C++, PHP, Cocoa Mac App developer.
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeUse my commented version and it will crash? I must be going cross-eyed. :confused: I don't see the problem....
I'm gonna bump up your reputation, though. Thanks. Your solution works fine.
iPad Apps Blog - Send me a code for your app, and I'll review it
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeiPad Apps Blog - Send me a code for your app, and I'll review it
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeI had to put a table view above the buttons. Though I could use a xib to make a view like actions sheet and animate up.
anyway, to put any image or view above the buttons and receive events, add that view to the actionsheet's superview. Like :
df.frame = CGRectMake(0, 0, 320, 200);
[[actionSheet superview] addSubview:df];
[[actionSheet superview] sendSubviewToBack:df];
Hope it helps :)
Expert in Java/Spring/OSGi, iOS app development.
Enthusiastic C/C++, PHP, Cocoa Mac App developer.
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeRegards.
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeThis works fine for adding an image to an action sheet. but i want to add a label to the action sheet. How should i add the label. Can i have some sample code..
Thanks in advance.
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeExpert in Java/Spring/OSGi, iOS app development.
Enthusiastic C/C++, PHP, Cocoa Mac App developer.
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeIt is not giving any errors but when we dismiss the action sheet the label is not dismissed with the action sheet. The label dismissed after action sheet got dismissed. that is my problem..
Thanks for the reply.
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesometry this line instead:
Does this work now?
Expert in Java/Spring/OSGi, iOS app development.
Enthusiastic C/C++, PHP, Cocoa Mac App developer.
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeExpert in Java/Spring/OSGi, iOS app development.
Enthusiastic C/C++, PHP, Cocoa Mac App developer.
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeIn some method that initiates the display of the action sheet (I'm triggering off of an NSNotification but it could be any method):
- (void)notifyShowSuccessActionSheet:(NSNotification *) notification {
NSLog(@\"In ETITMainViewController notifyShowSuccessActionSheet\n\");
UIActionSheet *successActionSheet = [[[UIActionSheet alloc] initWithTitle:nil
delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:@\"Do More\", @\"Done\", @\"Another Test?\", @\"Yet Another\", nil] autorelease];
[successActionSheet setOpaque:NO];
[successActionSheet setAlpha:0.8];
[successActionSheet showFromToolbar:[[self naviController] toolbar]];
}
...and in willPresentActionSheet:
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet {
UIImageView* successImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@\"CheckMark64.png\"]];
NSInteger itemPadding;
NSInteger topPadding = [[[actionSheet subviews] objectAtIndex:0] frame].origin.y;
if ([[actionSheet subviews] count] > 1) {
itemPadding = [[[actionSheet subviews] objectAtIndex:1] frame].origin.y
- ([[[actionSheet subviews] objectAtIndex:0] frame].origin.y
+ [[[actionSheet subviews] objectAtIndex:0] frame].size.height);
}
else {
itemPadding = [[[actionSheet subviews] objectAtIndex:0] frame].size.height / 4;
}
// resize action sheet frame to make space for image
[actionSheet setFrame:CGRectMake([actionSheet frame].origin.x,
[actionSheet frame].origin.y,
[actionSheet frame].size.width,
[actionSheet frame].size.height + [successImageView frame].size.height + itemPadding)];
// re-position buttons
for (UIControl *button in [actionSheet subviews]) {
[button setFrame:CGRectMake([button frame].origin.x,
[button frame].origin.y + [successImageView frame].size.height + itemPadding,
[button frame].size.width,
[button frame].size.height)];
}
[successImageView setFrame:CGRectMake(([[actionSheet superview] frame].size.width / 2) - [successImageView frame].size.width / 2,
topPadding,
[successImageView frame].size.width,
[successImageView frame].size.height)];
[actionSheet addSubview:successImageView];
}
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeHowever, this isn't doing what I had hoped.
I'm implementing the actionsheet
The delegate method adds the image and pushes the buttons lower. The buttons are so low, in fact, that you can't see them. Can you point me in the direction of changing the verticle position of the actionsheet so that I can see the image and all the buttons? Thanks again.
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeCan I know where can I get the sample to integrate Instagram.Am trying it from last days.Even iphone hooks.
Thanks
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeiPad Apps Blog - Send me a code for your app, and I'll review it
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesome