Checkmark Not Showing Up On IPad In UITableView
I want the user to be able to select a single row in a UITableView
and then have that row show the Checkmark accessory. First to check how it looks in the UI, I added the checkmark through the XCode Interface Designer, like this;
Ran it on the iPhone X Simulator and it works as expected.
But when I run it on the iPad Pro (12.9 inch) (2nd generation) Simulator it doesn't show up.
So I thought that maybe the constraints were the issue, so I tried writing the widths of all the views that could be the problem to the console and they all returned 1024 so that is correct.
When I try setting the checkmark through code I have the same problem.
Am I missing something here?
Answer
Your issue is definitely about constraints
and Auto Layout
.
You should set constraints to superView for checkmark : trailing/top/bottom
Horizontal spacing between the
UILabel
and theCheckmark
.And Edit this last constraint to make it "Greater or equal" so that it will eventually grow with bigger screen. You will also want to change your content hugging priority.
Simpler solution :
You could also useUIStackView
in order to proportionally align your label and your checkmark regardless of the screen resolution.
Related Questions
- → Function Undefined in Axios promise
- → What are the pluses/minuses of different ways to configure GPIOs on the Beaglebone Black?
- → Click to navigate on mobile devices
- → Playing Video - Server is not correctly configured - 12939
- → How to allow api access to android or ios app only(laravel)?
- → Axios array map callback
- → Access the Camera and CameraRoll on Android using React Native?
- → Update React [Native] View on Day Change
- → Shopify iOS SDK - issue converting BuyProductVariant to BuyProduct
- → BigCommerce and shopify API
- → Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `ListView`
- → React Native - Differences between Android and IOS
- → What is the difference between React Native and React?