Xcode -Set UIIMageView equal width-height with UITableViewCell - xcode

I am building my custom cell and I want an ImageView to be equal with the Cell size(constraints for Height,Width) but I noticed that there is not option for that like other views(eg UIView). Am I missing something here or is there any workaround?
Thank you.

Solution: Add constraints to center the Image View Horizontaly/Vertical and for Bottom/Top space.

Related

Xcode StackView with UIImageView incorrect spacing

My Storyboard
When it runs
Do u see the image that is down at the bottom? When I design it in storyboard, image with all above stuff is in a stackview with spacing of 8. Why the image is spaced from textfield too far away?
Do u guys know why?
Thanks
It looks like you have constrained the stack view to the bottom of its super view.
Remove the constraint at the bottom and it should allow the stack view to lay out its views properly.

iOS 8 imageView inside scrollView with autolayout not working

This is a very simple ViewController. I have an imageView inside a scrollView. Using autolayout I set scrollview's constraints to its view's edges. Also, imageView mode is AspectFit.
The image is provided at runtime, and it may be a landscape or portrait size. When I run the app, the image doesn't fit the current screen size. It seems that scrollView's boundaries are not being honored, thus only part of the image is being displayed. It used to work on ios7 and xcode5, but it's broken for ios8 xcode6.
Any ideas? I need to keep the use of autolayout whenever possible.
Your going to set the imageviews horizontal constraints and pin them to self.view (the scrollviews parent view) instead of the scrollview.
There is a good example of this here:
Using UIScrollView with Auto Layout in iOS
Try this to zoom out completely
[self.scrollView zoomToRect:self.imageView.frame animated:YES];
Have you tried a call to imageView.sizeToFit() in viewDidLoad? My impression is that imageView's size is fluid until the outlets are set. A call to sizeToFit forces the issue.

how to remove white borders from an UIImageView

I have an application , where I drag a circular UIImageView on top of another UIImageView , and since a circle could never be squared , the white borders of the image must show , so I wonder if there is a way to remove those borders or to hide them (not by making them have the same color ).
I am expecting that you are looking for image masking feature. Have a look at this tutorial and this one too. Both of them uses CoreGraphics frame functions and are really quicker in response.
Please note that it is not the Swift version but will give you atleast a starter.
try to set the image.layer.borderWidth = 0
(this is the swift version)

Subview of NSView get clipped when using CATransform3DMakeTranslation on layer of NSView

I have a NSView with three NSImageView subviews. I'm having trouble with the subviews clipping when I use CATransform3DMakeTranslation to translate along the x axis.
I primarily do iOS development and this is my first go in this realm. Any help would be greatly appreciated.
I ended up having to turn the Core Animation Layer on for the content view of my window. I found the answer here: How to make NSView not clip its bounding area?

How to make UIImage rounded,Not rounded corner

Draw a circle,make a rounded UIImageView in it.How to get this, please guide me.
thx!
Let's put it this way,
First we create a UIImageView to the size of the circle you want.Let's say you want this image to be a circular image,
http://united4iran.org/wp-content/uploads/2010/11/cell-phone-in-canada.jpg
Then you create another UIImageView one top of the previous one to the size of 320x480 and set this image to it (Assume this image size is 320x480),
Note: also remember that inner area of the circle in above image is transparent.
Then you should get a image like this,
http://img580.imageshack.us/img580/782/testjkn.png
Hope this will help you.

Resources