Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to manually transform the table. Here is some code to create and rotate a UITableView around its center.</p> <pre><code>// this defines a constant PORTRAIT_FRAME, which is the frame of the iPhone screen // minus the Status Bar. Equivalent to CGRectMake(0,20,320,460). #define PORTRAIT_FRAME [[UIScreen mainScreen] applicationFrame] // this defines a constant LANDSCAPE_FRAME, for orienting the table sideways #define LANDSCAPE_FRAME CGRectMake(0,20,480,300) // this function assumes you have a class variable called myTableView // and it toggles the orientation of myTableView - (void) rotateTable { if (myTableView.transform == CGAffineTransformMakeRotation(0)) { // rotate the image by 90 degrees myTableView.transform = CGAffineTransformMakeRotation(M_PI/2); myTableView.frame = LANDSCAPE_FRAME; return; } // set the image to its original orientation myTableView.transform = CGAffineTransformMakeRotation(0); myTableView.frame = PORTRAIT_FRAME; } </code></pre> <p>If you want to trigger this rotation on a button click, then declare a UIButton and assign this function as the action. Here's a function to create a UIButton. Just pass it @"rotateImage" for the action and self for the target. </p> <pre><code>+ (UIButton*) getButtonAtPoint:(CGPoint)point target:(id)target action:(NSString*)action { UIButton *button = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; [button addTarget:target action:NSSelectorFromString(action) forControlEvents:UIControlEventTouchUpInside]; return button; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload