0

In the form pictured below, as you can see, all of the items are aligned to the right in portrait mode. However, in landscape mode, the text box and switch do not move to the right with the detail items. The detail cells use an apple template, while the ones with the text box and switch are custom cells. How do I set it up in interface builder so that the switch and text boxes move over to the right?

I've been messing with this for a while with no success and haven't found any useful information googling.

app portrait mode app landscape mode

Peronix
  • 139
  • 1
  • 9

1 Answers1

1

If you're using a custom cell, you need to set the autosizing mask to keep the right margin fixed on the views you want to align right, something like this:

enter image description here

Adis
  • 4,512
  • 2
  • 33
  • 40
  • The autosizing control is not available to me as I am using autolayout. Do you know how to do this using constraints? – Peronix Oct 26 '12 at 00:41
  • do you have to use auto layout? you can switch that off as it is only a simple custom cell. Also, you can make the uilabel to align right :D – mashdup Oct 26 '12 at 09:50
  • Unless you're specifically targeting iOS6 and up, I'd turn off the autolayout for now. If you really want to use autolayout, check out this fancy tutorial, you will probably find what you need there: http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2 – Adis Oct 26 '12 at 10:57
  • Thank you, that was a lot of help. All of the controls I needed were in the editor menu. Never thought to look there as usually everything is laid out in the navigation panes. Just click on the view and go to editor, pin, trailing space to superview. For some reason it created fixed constraints for trailing space, width, AND leading space. The width constraint is overridden by the other two. For the buttons I deleted the leading constraint to stop it stretching, and for the text box I deleted the width constraint to allow it to stretch. – Peronix Oct 26 '12 at 16:11