Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios4 UIActionsheet定向问题_Ios4_Rotation_Orientation_Uiactionsheet - Fatal编程技术网

Ios4 UIActionsheet定向问题

Ios4 UIActionsheet定向问题,ios4,rotation,orientation,uiactionsheet,Ios4,Rotation,Orientation,Uiactionsheet,我正在和pickerview一起研究行动单的方向。它在potrait模式下运行良好,但在横向模式下不起作用。我能知道我哪里出错了吗 问候,, 萨提斯 - (IBAction)openActionSheet { UIView *ui_pickerview = [[[UIView alloc] initWithFrame:CGRectMake(0, 160, 320, 305)] autorelease]; pickerViewPopup = [[UIActionSheet alloc] i

我正在和pickerview一起研究行动单的方向。它在potrait模式下运行良好,但在横向模式下不起作用。我能知道我哪里出错了吗

问候,, 萨提斯

- (IBAction)openActionSheet
{

 UIView *ui_pickerview = [[[UIView alloc] initWithFrame:CGRectMake(0, 160, 320, 305)] autorelease];

 pickerViewPopup = [[UIActionSheet alloc] initWithTitle:@""
              delegate:self
           cancelButtonTitle:nil
         destructiveButtonTitle:nil
           otherButtonTitles:nil];

 UIImageView *pickerImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0,44,320,213)];
 pickerImageView.image = [UIImage imageNamed:@"picker.png"];

 UIImageView *homeImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5,137,30,24)];
 homeImageView.image = [UIImage imageNamed:@"picker_icon_home.png"];

 m_pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0,44,0,0)];
 m_pickerView.delegate = self;
 //m_pickerView.dataSource = self;
 m_pickerView.showsSelectionIndicator = NO; 
 //pickerView.


 pickerToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
 pickerToolbar.barStyle = UIBarStyleDefault;
 pickerToolbar.tintColor = [UIColor colorWithRed:134/255.0 green:187/255.0 blue:34/255.0 alpha:1];
 [pickerToolbar sizeToFit];

 NSMutableArray *barItems = [[NSMutableArray alloc] init];

 UIBarButtonItem *doneBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(DonePicker:)];
 [barItems addObject:doneBtn];
 [doneBtn release];

 UIBarButtonItem *flexSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];
 [barItems addObject:flexSpace];
 [flexSpace release];


 UIBarButtonItem *cancelBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(closePicker:)];
 [barItems addObject:cancelBtn];
 [cancelBtn release];

 [pickerToolbar setItems:barItems animated:YES];
 [barItems release];



 [pickerViewPopup addSubview:pickerToolbar];
 [pickerViewPopup addSubview:m_pickerView];

 //[pickerViewPopup addSubview:pickerImageView];
 [pickerImageView release];

 //[pickerViewPopup addSubview:homeImageView];
 [homeImageView release];

 [pickerViewPopup showInView:ui_pickerview];
    [pickerViewPopup setBounds:CGRectMake(0,0,320, 464)];

}

如果未将UIActionSheet添加到处理横向方向的视图控制器,则UIActionSheet将以纵向显示