UIAlertView is it possible to put image as Title? - objective-c

As I said of title, is it possible to send an image to an UIAlertView to show as the title?
Other way I can do this is showing no title and sending the image as content and after the image, show the rest of the text.
Thanks in advance.

No, the UIAlertView does not support images in the title. Also you should not attempt to insert your own UIImageView in UIAlertView as stated in the official documentation :
The UIAlertView class is intended to be used as-is and does not
support subclassing. The view hierarchy for this class is private and
must not be modified.
Just create you own view which you present, you can present it in it's now UIWindow to roll you own alert view.

Related

UIAlert - change message font size IOS7

I have a working UIalert view with text field and 2 buttons.
I want the text in the message to be a bit bigger, how can I do it?
thanks,
Shlomi
The UIAlertView cannot be changed. If you wish to modify it, you will need to create your own from scratch.
Please see the UIAlertView Class Reference, and under subclassing notes:
The UIAlertView class is intended to be used as-is and does not
support subclassing. The view hierarchy for this class is private and
must not be modified.

how can I have a totally transparent UIAlertView?

I need a UIALertView, which on popping up should be transparent enough to show the background behind the alertview in a faded way and the blue color of the alert view should not appear since the background behind the alert view is black and grey in color. Changing color and putting an image to the alert view is one thing which can be seen in the links : iOS 5 black transparent UIAlertView and Changing the background color of a UIAlertView?
but I need a transparent UIAlertView. Is it possible to get one?If yes how?
Thanks for the help in advance.
If you look at Apple's documentation page for UIAlertView you'll see this note:
The UIAlertView class is intended to be used as-is and does not
support subclassing. The view hierarchy for this class is private and
must not be modified.
In other words, Apple doesn't want developers to muck around with colors or fonts or backgrounds when it comes to UIAlertView. If Apple changes the internal guts of UIAlertView in a later iOS, your app is likely to have unexpected and not-desired effects when that modified alert appears.
If you want custom UIAlertView like behavior, why not just write your own UIView that looks and behaves a lot like UIAlertView. And then you have full control over everything about how it's drawn.
As Michael said, you can't with an UIAlertView, you have to build it yourself.
You can try BlockAlertsAnd-ActionSheets, it is like a customizable UIAlerView
https://github.com/gpambrozio/BlockAlertsAnd-ActionSheets
I know it's too late but,
I'll leave this command for other developers.
.h
#interface CustomAlertView:UIAlertView {}
.m
// override
- (void)drawRect:(CGRect)rect
{
for(UIView * sub in self.subviews)
{
[sub removeFromSuperview];
}
// this removeFromSuperview will clear all thing such as background view and buttons
// do something
}

Is it possible to show a UIAlertView inside a Specific UIView?

I doubt this is possible but, Is it possible to show a UIAlertView inside a UIView?
No, UIAlertView is actually another UIWindow that goes above you application's main window. The same is valid for the keyboard too.

UIImageView in PopOver not changing?

I'm making an app and it has multiple button that when you press them it open a pop over view (using Storyboard.) The image is blank in IB (I set it that way) and my buttons are ment to populate the image view. This is the code I'm using:
[popoverImageView setImage:[UIImage imageNamed:#"telegraph.jpeg"]];
Steps (in order run)
Popover opens
Above code is run
Some notes:
The image is case matched.
The image is built-into the bundle
Anyone able to shed some light?
if you haven't read Apples View Controller Catalog for iOS you should read it.
I would check your popoverImageView's viewDidLoad/viewWillLoad and see if it is clearing your View before it presents itself.
Check your popoverImageView's properties they may not be linked properly
Enjoy using the storyboard I find it a pain for Popover's
Without any information regarding the the interface for your Popover and the implementation of the function where you call [popoverImageView setImage:[UIImage imageNamed:#"telegraph.jpeg"]]; and your setImage function i can't be sure of your exact problem

Replicate apple's mailComposer UITextView?

I want to replicate apple's default mail composer for my app. I don't want to use default mailcomposer because I'm having a lot of other things. Does anybody have solution for this? Main thing I want to implement is attachments. Like when you select a image and tap on email on photos app. The image preview is displayed in body part and also we can enter text and the cursor also detects the image when you press return or back. That functionality I want to achieve.
The TTMessageComposer in the Three20 library is a good start... it doesn't have attachment support but will save you time on the standard layout.
Three20 library
Check out this source code https://github.com/thermogl/TITokenFieldView, it's a custom UI class for token fields but there is a exact replica of Apple's mail UITextView. Heres a snippet from the source. All you have to do is create an normal text view and add it to your view.
// Creating the text view
messageView = [[UITextView alloc] initWithFrame:yourView.contentView.bounds];
// Adding it as a subview
[yourView.contentView addSubview:messageView];
// Set the frame so it resizes with the view.
[messageView setFrame:yourView.contentView.bounds];