uiimageview

How to hide/show the UIimageview?

谁说我不能喝 提交于 2019-12-05 05:56:12
- (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; CGRect viewRect = CGRectMake(250, 100, 30, 30); as = [[UIImageView alloc] initWithFrame:viewRect]; as.backgroundColor=[UIColor clearColor]; UIImage *img = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"check" ofType:@"png"]]; [as setImage:img]; [self.view addSubview:as]; BOOL test= [[NSUserDefaults standardUserDefaults] boolForKey:@"switch"]; NSLog(@"%@", (test ? @"YES" : @"NO")); if(test == YES) { as.hidden=NO; } else { as.hidden=YES; } } The test results YES but the imageView doesn't listen the

Rendering mode set to Template for vector pdf in image catalogue, but UIImageView wont tint the image in a custom cell

主宰稳场 提交于 2019-12-05 05:29:17
I have migrated all my image files to the asset catalogue. All of them are pdf vectors of size 1x. They are set to render as a Template. They show up fine everywhere in size and in color. But there is this one custom TableView Cell from a xib that I has 6 UIImageView s linking to 6 of these images from the catalogue. Somehow they don't respect the tint color, neither default nor custom. Tried changing them programmatically but didn't work either. These same images show up fine in another tableview with static cells inside the main storyboard. I am not able to isolate the issue. Interestingly,

Siri chat bubble color's in iOS

大城市里の小女人 提交于 2019-12-05 05:25:04
问题 I tried creating the Siri chat bubble in core graphics. I am at a stage where I can draw the shape. I am stuck with the color's here. Wanaa get the border color and the fill color code. here is what I did so far.. - (void)drawInContext:(CGContextRef)context { CGRect rect = gradientRectFrame; CGFloat radius = 30; CGFloat originBufferX = 0.0; CGFloat originBufferY = 0.0; CGFloat rightAngleTriangleWidth = 20.0; CGFloat rightAngleTriangleHeight = 20.0; CGFloat fullRectWidth = rect.size.width;

UIViewController IBOutlets are nil

北城以北 提交于 2019-12-05 05:11:48
I have an UIViewController class with two labels and a UIImageView set as IBOutlets, and I have this outlets connected in my xib, I have double checked they are connected properly, however when I check the their value in the debugger they are 0x0 so I cant change them programatically. Any ideas on what I might be doing wrong. Heres the header file of my code: #import <UIKit/UIKit.h> @interface PlateDetailViewController : UIViewController { IBOutlet UIImageView *image; IBOutlet UILabel *price; IBOutlet UILabel *description; } @property (nonatomic, retain)IBOutlet UIImageView *image; @property

Whats the correct way to alloc a UIImage to memory and release it iphone

拟墨画扇 提交于 2019-12-05 05:00:09
问题 Using Instruments, I keep on getting pointed to a memory leak with a UIImage. I think I'm assigning and releasing the memory correctly. The leaked object in instruments is described as NSConcreteData Is the following the correct way to assign and release a UIImage? UIImage* flagimg = [UIImage imageWithData: [NSData dataWithContentsOfURL:url2]]; [flagimg release]; flagimg =nil; 回答1: [UIImage imageWithData:] returns an autoreleased object, which should not be released by you again. So this code

Memory problems when pushing many view controllers on UINavigationController

孤者浪人 提交于 2019-12-05 02:51:47
问题 I'm making an interactive book for the iPad and am using UINavigationController to implement the navigation between a page and the next. When a user turns the page, the next page is pushed on top of the navigation stack. I'm now 15 pages into the app, and the app crashes when I try to go from page 14 to page 15. No error message in the console, nothing in the device's crash logs neither. Each view controller's scene in the storyboard has UIImageViews displaying images that are between 5MB and

iOS blur effect to ImageView with Swift

一曲冷凌霜 提交于 2019-12-05 02:44:59
问题 I am trying to make simple iOS app. I need to make image view with blur effect. I found this code on Stack Overflow: class BlurImageView: UIImageView { override func awakeFromNib() { super.awakeFromNib() } required init(coder aDecoder: NSCoder!){ super.init(coder: aDecoder) var blur:UIBlurEffect = UIBlurEffect(style: UIBlurEffectStyle.Light) var effectView:UIVisualEffectView = UIVisualEffectView (effect: blur) effectView.frame = frame addSubview(effectView) } } And I need to connect this

iOS UITableViewCell cell.imageView setting rounded corner

十年热恋 提交于 2019-12-05 02:37:53
Hey all I am trying to set cell.imageView 's cornerRadius , but it doesn't seem to work. cell.imageView.layer.cornerRadius=9; Will it work or should I add a custom UIImageView in my cell to have rounded corners? I also tried this cell.imageView.layer.borderWidth=2; cell.imageView.layer.borderColor=[[UIColor blackColor]CGColor]; But it also doesn't seem to work. Has anybody faced a similar issue? Navnath Godse First add Framework -> QuartzCore.framework to your project then import header file in your ViewController.m file #import <QuartzCore/CALayer.h> Add following code in your

How to create a multistage UIImageView animation?

会有一股神秘感。 提交于 2019-12-05 02:14:03
问题 I'm trying to do a multistage animation, so that a UIImageView (1) fades in, (2) moves, (3) slide off the screen. Only stage 1 seems to work. What am I doing wrong? Here's the code: // FIRST PART - FADE IN -(void)firstAnim { // 'sprite' is a UIImageView [sprite setAlpha:0.1f]; [UIView beginAnimations:@"anim1" context:NULL]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationDuration:0.25]; [UIView setAnimationDidStopSelector:@selector(secondAnim)]; [UIView setAnimationCurve

Display images from Gallery in iPhone

妖精的绣舞 提交于 2019-12-05 01:44:19
问题 I am new in iPhone and in learning phase now a days. Actually i want to implement that i read images stored in my iPhone PHOTO Gallery and then display it onto my application. I have searched in many Search Engines but could not find any thing. You all are professionals over here. Please guide me thrrough some code or some tutorial. Thanks alot 回答1: Edit Also check out this question/answer and the method that is used to get the image from uiimagepickercontroller as the method that i have