iphone - how can i change orientation by button's click events? -


I used TableView and click on the Disclosure button to use the Disclosure button. I've got a special image. I want to be able to get that special image with the orientation when I press the disclosure button, so how can I do this? Please help me I'm new in this kind of application.

You have to manually convert the tables. Here's some code to create a center and rotate a UITableView around its center.

  // This defines a continuous PORTRAIT_FRAME, which is equivalent to the iPhone screen / CGRactMake (0202020460) #define PORTRAIT_FRAME [[UIScreen mainScreen] applicationFrame] // This is a continuous LANDSCAPE_FRAME Defines, in the LANDSCAPE_FRAME CGRectMake #define table for sideways (020480,300) // This function assumes that your square variable is called myTableView // and toggle it to the orientation of myTableView - (zero) rotateTable {if (myTableView .transform == CGAffineTransformMakeRotation (0)) // // rotate image by myTableView.transform = CGAffineTransformMakeRotation (M_PI / 2); MyTableView.frame = LANDSCAPE_FRAME; Return; } // Set your original orientation to myTableView.transform = CGAffineTransformMakeRotation (0); MyTableView.frame = PORTRAIT_FRAME; }  

If you want to speed this rotation click on a button, then declare a UIButton and assign this function as action. Here's a function to create UIButton, just follow the action for the target and @ "Rotate Image" for yourself.

  + (UIButton *) getButtonAtPoint: (CGPoint) Point Target: (ID) Goal Action: (NSString *) Action {UIButton * button = [UIButton buttonWithType: UIButtonTypeDetailDisclosure]; [Button addTarget: target action: NSSelectorFromString (action) forControlEvents: UIControlEventTouchUpInside]; Return button; }  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -