3

I am trying to add a custom checkbox button (https://codereview.stackexchange.com/questions/69123/ibdesignable-uicheckbox) to my Prototype Table View Cell in my Storyboard.

Here is an album ending starting with how it looks on all 3 iPhone sizes and ending with a picture of my Interface Builder: http://imgur.com/d6ejxEL,9NpqcnA,4gdLnMT,g24FYID#0

How would I get the Checkbox to appear where it does on the iPhone 6 on all 3 sizes? Thanks in advance.

Community
  • 1
  • 1
nintyapple
  • 227
  • 1
  • 3
  • 13
  • What about using the view as the accessoryview of the cell? [cell setAccessoryView:btnCheckMark]. – Teddy Apr 26 '15 at 05:39

2 Answers2

2

You should add auto layout constraints. In storyboards, you can add auto layout to make the button stay on the right like this:
I used a switch to demonstrate.

1) Select the "Button".

2) Click the icon on the bottom circled in red.

3) Constrain the space between the superview (the content view) and the "button".

You can add different constraints like top or left spacing.

4) Click "Add # constraints"

Community
  • 1
  • 1
Taylor M
  • 1,855
  • 1
  • 14
  • 20
1

Add auto layout constraints to the checkmark. You can do this by right clicking or control + clicking. You'll need at least two (a constraint from the checkmark to the top of the content view and one to the trailing space).

One constraint will keep it in vertical position, one will keep it in horizontal position.

Fred Faust
  • 6,696
  • 4
  • 32
  • 55