Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to change uipickerview in landscape?
    primarykey
    data
    text
    <p>Here i developing application. I could not change pickerview in landscape mode. Here is my code. </p> <pre><code> -(IBAction) showPicker:(UIControl *)sender { UIActionSheet *menu = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:@"Done" destructiveButtonTitle:nil otherButtonTitles:nil]; menu.tag=1; UIPickerView *pickerView; if (self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft || self.interfaceOrientation == UIInterfaceOrientationLandscapeRight) { pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(-80,70,220,0)]; pickerView.delegate = self; pickerView.dataSource = self; pickerView.showsSelectionIndicator = YES; [menu addSubview:pickerView]; [menu showInView:self.view.superview]; [menu setBounds:CGRectMake(0,0,320, 470)]; [pickerView release]; [menu release]; NSLog(@"Landscape"); } else { NSLog(@"Portrait"); pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0,70,220,0)]; pickerView.delegate = self; pickerView.dataSource = self; pickerView.showsSelectionIndicator = YES; [menu addSubview:pickerView]; [menu showInView:self.view.superview]; [menu setBounds:CGRectMake(0,0,320, 470)]; [pickerView release]; [menu release]; } } - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { return [arrayNo count]; } - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { return 1; [entered2 resignFirstResponder]; } - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { entered2.text=[arrayNo objectAtIndex:row]; [entered2 resignFirstResponder]; } - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { return [arrayNo objectAtIndex:row]; } - (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component { int sectionWidth = 300; return sectionWidth; } </code></pre> <p>In my application i created portrait mode ran fine. But when i try to write code in landscape mode it can positioned wrongly. How can i do this. How can i change landscape mode. Anybody help me. Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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