Content inset not working Storyboard Xcode8
Recently I have updated Xcode 7.3 to 8. While opening the project the project settings also have been updated for new Xcode.
Now the insets given for a button image for positioning the image inside button frame is not working as in previous Xcode(7.3) version.
The image insets are given through storyboard. Image was used here to have large clickable area for button than the button image display area. Is there any other options to get it through storyboard.
- CoreBluetooth repeatedly disconnecting
- How do I change the UIPageViewController from WITHIN one of the UIViewControllers that is part of the UIPageViewController?
- UICollectionView interactive layout transition using iOS 7 APIs
- RESTKit POST Request Tutorial
- Swift does not conform to protocol
- Linking a static library to an iOS project in XCode 4
5 Solutions Collect From Internet About “Content inset not working Storyboard Xcode8”
In Xcode 8 the button content/title/image insets have moved to the Size Inspector tab:
Which seems quite logical by the way! 😀
I had this same problem and solved it with image insets and the Horizontal/Vertical Alignment controls. My problem was that I had the wrong alignment controls selected. Once I changed it my insets worked properly for what I was trying to accomplish.
I created a button with an image and the I wanted to shrink the image down to not fill up the entire button So I set the image to the UIButton image property in storyboard and then set the image insets to my liking
But it did not center my image with the inset of 5 on each side. The image would look like this and that was not what I wanted
If you change the horizontal/vertical alignment controls I was able to the button image to my desired look I wanted
Its weird,but it actually works until you add collectionview or tableview in your Viewcontroller. Try setting the inset without having the scrollview or tableview in your view controller
There is a weird behavior when having a
UIScrollView on the scene (as mentioned by @RAHUL JOSHI). Sample
Solution: Just ignore the previsualization bug as on runtime this will work normally.
Content inset for button is working perfect in xcode 8 beta.
See below screenshot that i have taken from xcode8 beta.
- How long since last time app was opened in iOS?
- Refresh view after UIBarButtonItem is clicked
- Using .pch file to include applcation files
- Run XCTest bundle with simctl
- Which is the Swift equivalent of isnan()?
- Is there a simple way to split a NSString into an array of characters?
- Swift Merge audio and video files into one video
- Method Swizzling in iOS 5?
- Parsing XML in Cocoa
- iPhone 6.1 simulator screen resolution is 320×548 instead of 640×1136, why does it heppend?
- crash on setUserTrackingMode with MKMapView when zoomed in
- “changing property masksToBounds in transform-only layer, will have no effect” in Xcode 7
- Swift 2 protocol extension not calling overridden method correctly
- How do you load custom UITableViewCells from Xib files?
- Xcode 5 and iOS 7: Architecture and Valid architectures