How to center a control on mobile?

Hi all,

For a web app shown in ordinary browser, I can easily centre a control by:

WebButton.left = (self.width - WebButton.width) / 2

But when it is displayed on iPhone, the button did not shown in the position as desired. I understand iphone counts in points while web counts in pixels. I do not need total responsive but adaptive is adequate to me. Please someone show me how.

What happens if you center the control in the IDE and uncheck both the left & right anchors for that control in the inspector?

It still appears on the right hand side of the screen

Make sure the minimum width for the WebPage is <= the width of the device.