uiimageview

tvOS: Rounded corners for image view when focused

喜夏-厌秋 提交于 2019-12-07 05:54:15
问题 I have an image view that will get this awesome tvOS focus effect when the containing view gets focused. The problem is - it should have rounded corners. Now this is easily done: imageView.layer.cornerRadius = 5 imageView.layer.masksToBounds = true I have to set either masksToBounds of the layer or clipsToBounds of the image view to true (which is basically the same), in order to clip the edges of the image - but as soon as I do this, the focus effect won't work any more, because it will get

drag and drop uiimage into another uiimageview

送分小仙女□ 提交于 2019-12-07 05:43:55
问题 I am using following code snippet to drag and drop uiimageview UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(move:)]; [panRecognizer setMinimumNumberOfTouches:1]; [panRecognizer setMaximumNumberOfTouches:1]; [panRecognizer setDelegate:self]; [myImageView addGestureRecognizer:panRecognizer]; -(void)move:(id)sender { CGPoint translatedPoint = [(UIPanGestureRecognizer*)sender translationInView:self.view]; if([(UIPanGestureRecognizer*

How to get Google Map's 'myLocationEnabled' blue dot always on top

会有一股神秘感。 提交于 2019-12-07 05:06:36
问题 This is an example of a UIImageView inside of a GMSMapView. My problem is that Google's blue dot is showing behind the UIImageView...How can I get this blue dot for myLocationEnabled to always show on top? @IBOutlet weak var mapView: GMSMapView! func locationManager(manager: CLLocationManager!, didChangeAuthorizationStatus status: CLAuthorizationStatus){ NSLog("Did Change Authorization Status") if status == CLAuthorizationStatus.AuthorizedWhenInUse { //This uses the location manager if

Resizing UIImageView inside a UITableViewCell

主宰稳场 提交于 2019-12-07 04:58:28
in my app the UITableViewCell size are dynamic which means each has it's own height. inside of each cell there is a background image in a UIImageView . Through storyboard, i used autolayouts to customize the UIImageView to automatically stretch as the cell is stretched. The problem is that when they stretch the whole image stretches with the corners. So i was looking up online and i came over using resizableImageWithCapInsets: in order to stretch the stretchable sides and exclude the unwanted ones. So i tried the following code in tableView: cellForRowAtIndexPath: as i wanted the image to be

Remove alpha channel from UIImage

℡╲_俬逩灬. 提交于 2019-12-07 04:45:05
问题 I use the following method to get a decompressed uiimage from file system. However the UIImageView is colored as red when I turn on the color blended layer, even though the UIImageView is set to Opaque. The images on file system don't have alpha channel. I tried set CGContextSetAlpha(bitmapContext, 1), but still has blended layer. Anyone know how to remove alpha channel when using CGContextDrawImage? - (UIImage *)decompressedImage { CGImageRef imageRef = self.CGImage; CGRect rect = CGRectMake

Anti Alias, UIImage and Performance

和自甴很熟 提交于 2019-12-07 04:06:32
问题 I have a UIImage loaded into a UIImageView . The UIImage is larger than the UIImageView and it has been scaled down to fit. Obviously the scaled down UIImage shows jagged edges. What is the best way to anti-alias this image with regards to performance? I've seen this method using drawInRect but I've also read that drawInRect does not give the best performance. I've read several different articles and I've tried a few methods myself. But after reading a few more posts on the performance

How to hide/show the UIimageview?

♀尐吖头ヾ 提交于 2019-12-07 03:13:29
问题 - (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

What is use of stretching property of UIImageView. How I can use this property.?

纵饮孤独 提交于 2019-12-07 01:37:02
问题 I want to know how can i use this property for UIImageView. 回答1: Stretching properties are pretty simple, as stated by Karol Kozub in this article: The fraction of the original image left without stretching on the left is specified by X The fraction of the original image that gets stretched in the x-axis is specified by Width The fraction of the original image left without stretching on the right is equal to 1 – X – Width If we use 0 for Width the stretched area will interpolate between the

iOS UITableViewCell cell.imageView setting rounded corner

这一生的挚爱 提交于 2019-12-06 23:17:27
问题 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? 回答1: First add Framework -> QuartzCore.framework to your project then import header file in your

objective c subclass UIImageView

谁说我不能喝 提交于 2019-12-06 21:40:35
I'm trying to subclass UIImageView to add some custom functionality in it. I started trying to do the basics, just init an object with a given image and display it on the screen. Using UIImageView everything works fine, but if i change my object from UIImageView to my custom class, no image is displayed. Here's what i've done so far: //Imager.h #import <UIKit/UIKit.h> @interface Imager : UIImageView { } -(id) init; -(void) retrieveImageFromUrl: (NSString *)the_URL; @end //Imager.m #import "Imager.h" @implementation Imager @synthesize image; -(id)init { self = [super init]; return self; } -