Questions tagged [uiviewcontentmode]

A flag used to determine how a view lays out its content when its bounds change.

A flag used to determine how a view lays out its content when its bounds change.

For more detail read UIView Class Reference

20 questions
159
votes
3 answers

Difference between UIViewContentModeScaleAspectFit and UIViewContentModeScaleToFill?

what is the difference between UIViewContentModeScaleAspectFit and UIViewContentModeScaleToFill...?
Madhumitha
  • 3,794
  • 8
  • 30
  • 45
11
votes
2 answers

ViewController not being deallocated due to internal retain cycle

Some of my view controllers don't get deallocated after being popped from view. I've gotten rid of the other strong references so I'm left with this internal retain cycle held through a reference form _externalObjectsTableForViewLoading. It's a…
Carlos
  • 139
  • 7
3
votes
2 answers

View as SubView VS ChildViewController

Can any one explain when should we add a UIViewController as ChildViewController? What is the benefits of adding it as ChildViewController instead of subView? Please help me to understand the purpose of ChildViewController.
3
votes
1 answer

Align UIImageView with contentMode AspectFill AND Top

When I use AspectFill, the image will be centered in image view, top and bottom are cut off. But I want it to start from top, not center. I see many questions but they're all about AspectFit, not AspectFill. Is there anyway to apply both AspectFill…
kientux
  • 1,782
  • 1
  • 17
  • 32
1
vote
1 answer

Before/after iOS tool

I want to make something like this: Reference of image. What I do: two UIImagesView, one with UIViewContentModeLeft and another with UIViewContentModeRight. I have a slider where I can change image frames. The solution seems to be ok, but I am not…
heming
  • 93
  • 10
1
vote
1 answer

Is it possible to use launch image for universal app in imageview of launchsceen.xib or launchscreen.storyboard?

I have to use launch images in imageview of launch storyboard. But it's not supporting all orientations, and if I do scaleToFill in contentmode of imageview, then the image looks stretched. Can anybody help me?
1
vote
1 answer

How to add border to a UIImage which has content mode set to aspect fill

I have set photoImageView.contentMode = UIViewContentMode.ScaleAspectFill. I want to put a border for the image. But since the content mode is AspectFill, I don't know how to programmatically add a border just to the image. Is there any way to do…
JMS
  • 271
  • 4
  • 15
0
votes
0 answers

Remove top and bottom transparent spaces after UIViewContentModeScaleAspectFit - Objective-C

I have an image which I am using in my app. I am using UIViewContentModeScaleAspectFit to ensure it caters for different screen sizes by preserving aspect ratios. However, in small screen phones, this is inducing whitespaces at top and bottom and in…
rafavinu
  • 305
  • 4
  • 20
0
votes
1 answer

iOS Swift UIViewController Rotation

I have a UITabViewController with three tabs. On one of the tabs, the user taps a button and a new UIViewController controller pops up in Landscape mode (for the user to sign their name using their finger). After the user is finished, they tap a…
Perry Hoekstra
  • 2,687
  • 3
  • 33
  • 52
0
votes
1 answer

Xcode have 2 projects under 1 workspace

I have 1 workspace with project with project with swift3. Now I need to add other project or target. I am not sure. But the goal is to have the other project in swift4. It will be helper project for main project in swift3. And this second project…
Mark cubn
  • 507
  • 1
  • 4
  • 8
0
votes
0 answers

Are there any side effects by using contentMode property in my custom scrollview inherited from UIScrollView?

I want to use contentMode property on MyScrollView inherited from UIScrollView. Are there any effects to MyScrollView by using contentMode property?
tucan9389
  • 168
  • 2
  • 10
0
votes
0 answers

UIImageView's content mode changes when scrolling tableview

I have a table view (SlackTextViewController) with a custom UITableViewCell which contains an UIImageView and a UITextView. I use SDWebImage for caching and setting images. This is my cellForRowAtIndexPath: - (UITableViewCell…
badhanganesh
  • 3,427
  • 3
  • 18
  • 39
0
votes
3 answers

Calculate time taken to Navigating between one Screen to other Screen

All, In my project, we have some time delay (Performance) issue when Navigating from one Screen to another screen. Do we have any tool in Xcode to figure out which method is exactly causing the issue?
kiri
  • 1,977
  • 5
  • 27
  • 55
0
votes
1 answer

Overriding the class's property swift

I want to override the ContentMode of the UIImageView so I wrote this code but it doesn't seem to work as expected. class AspectFitUIImageView: UIImageView { override var contentMode: UIViewContentMode { get { return…
Anirudha Mahale
  • 2,526
  • 3
  • 37
  • 57
0
votes
1 answer

Transition from UIViewController to TabBarViewController

I have been searching for a solution for 6 hours, and come up with nothing that applies to my situation. my storyboard follows the flow of: TabBarViewController -> NavigationController ->TableViewController -> UIViewController (see picture…
1
2