uiimageview

How to set up different Auto Layout constraints for different screen sizes

大城市里の小女人 提交于 2020-01-30 14:15:23
问题 I have a tableView with static cells. The cell contains an ImageView which fills it completely. And I have another smaller ImageViews atop. I position this ImageViews with constraints. I have a question about resizing the constraints. How can I set different constraint constants for different devices sizes without programming if/else loops. Is there a way to set it in the storyboard? I have a leading constraint to parent layout for example with an constant value of 10. This is okay for the

Byte array shows value but the ImgView.Image shows null in ios

强颜欢笑 提交于 2020-01-25 20:36:48
问题 I am trying to display an image into UIImageView through this method NSData.FromArray() but it gives an null reference exception my code is the following: Byte _imgData = GetRawData(_imgPath); // this method get the byte array of size ([131072]) NSData _data = NSData.FromArray(_imgData); ImgView.Image = UIImage.LoadFromData(_data) //in this _data shows the byte array value but the ImgView.Image shows null Byte array get the RLE Compress data. ImgView.Image = UIImage.LoadFromData(_data) _data

Byte array shows value but the ImgView.Image shows null in ios

蓝咒 提交于 2020-01-25 20:35:13
问题 I am trying to display an image into UIImageView through this method NSData.FromArray() but it gives an null reference exception my code is the following: Byte _imgData = GetRawData(_imgPath); // this method get the byte array of size ([131072]) NSData _data = NSData.FromArray(_imgData); ImgView.Image = UIImage.LoadFromData(_data) //in this _data shows the byte array value but the ImgView.Image shows null Byte array get the RLE Compress data. ImgView.Image = UIImage.LoadFromData(_data) _data

Loading images on scrollview using lazy loading

◇◆丶佛笑我妖孽 提交于 2020-01-25 11:45:12
问题 I am working on an app in which I need to load nearly 211 images in a scrollview. What I was doing was I was converting the images in binary format (NSData) and saving them in core data. Then retrieving them and populating them on the scrollview. it does work, but sometimes it does throw "Memory warning". I learned that lazy loading is a way to achieve this. But, I am not totally aware of how it is done. Like, loading 3 or 5 images ahead/back of the image visible currently on the scrollview.

ImageView changes frame/bounds

耗尽温柔 提交于 2020-01-25 03:05:35
问题 I have been trying to find this issue here, but no topic seems to fit... I have a UINavigationController that pushes different kinds of UIViews containing images. When the controller pushes a new view, it the navigation bar is moved onto the screen and it appears that the image subsequently is being 'squelched' a bit - or it 'moves in from top' (I hope I described this sufficiently). Anyway, my image has the frame of 320x460 (because of the top bar). I couldnt find a proper setting, where the

ImageView changes frame/bounds

大兔子大兔子 提交于 2020-01-25 03:05:07
问题 I have been trying to find this issue here, but no topic seems to fit... I have a UINavigationController that pushes different kinds of UIViews containing images. When the controller pushes a new view, it the navigation bar is moved onto the screen and it appears that the image subsequently is being 'squelched' a bit - or it 'moves in from top' (I hope I described this sufficiently). Anyway, my image has the frame of 320x460 (because of the top bar). I couldnt find a proper setting, where the

cannot modify frame of UIImageView if added through Interface Builder

回眸只為那壹抹淺笑 提交于 2020-01-24 09:35:09
问题 I came across this very peculiar problem where I am unable to modify the frame of a UIImageView. I have isolated it to this very simple example. Starting from a default single view application xcode template, I add a UIImageView in Interface Builder, link it to the ViewController property called testImage, and in ViewController.m I add: -(void)viewDidAppear:(BOOL)animated{ UIImageView* maskImage = [[UIImageView alloc] initWithFrame:self.testImage.frame]; maskImage.image = self.testImage.image

UIImageView can't change position programmatically

为君一笑 提交于 2020-01-24 00:11:17
问题 I'm currently developing iPhone apps where i need to reposition the UIImageView. This is so far what i did so far: import UIKit import CoreGraphics import AVFoundation import QuartzCore class _DBubbleViewController: UIViewController { @IBOutlet weak var BubbleBackground: UIImageView! @IBOutlet weak var Bubble: UIImageView! override func viewWillAppear(animated: Bool) { Bubble.frame = CGRect(x: 168, y: 220, width: Bubble.bounds.size.width, height: Bubble.bounds.size.height) I have checked

Tiling a UIImageView using resizeableImageWithCapInsets:resizingMode?

僤鯓⒐⒋嵵緔 提交于 2020-01-23 20:02:10
问题 I'm using the following code to try to create a tiled image with cap insets, and seeing the image below as the results in the simulator. My source image is 145x83 pixels in size, and shown here too. What am I doing wrong? SOURCE IMAGE: RESULTS IN SIMULATOR: CODE: - (void)viewDidLoad { [super viewDidLoad]; UIImage *cloudImage = [UIImage imageNamed: @"cloud.png"]; [cloudImage resizableImageWithCapInsets: UIEdgeInsetsMake(10, 10, 10, 10) resizingMode: UIImageResizingModeTile]; UIImageView

Tiling a UIImageView using resizeableImageWithCapInsets:resizingMode?

十年热恋 提交于 2020-01-23 20:02:05
问题 I'm using the following code to try to create a tiled image with cap insets, and seeing the image below as the results in the simulator. My source image is 145x83 pixels in size, and shown here too. What am I doing wrong? SOURCE IMAGE: RESULTS IN SIMULATOR: CODE: - (void)viewDidLoad { [super viewDidLoad]; UIImage *cloudImage = [UIImage imageNamed: @"cloud.png"]; [cloudImage resizableImageWithCapInsets: UIEdgeInsetsMake(10, 10, 10, 10) resizingMode: UIImageResizingModeTile]; UIImageView