Commit 24cda19e authored by admin's avatar admin

修改bug

parent 810ea6c9
...@@ -70,17 +70,33 @@ ...@@ -70,17 +70,33 @@
// 移除显示Image的Button // 移除显示Image的Button
[button.superview removeFromSuperview]; [button.superview removeFromSuperview];
CGFloat btnH = 110;
CGFloat marginY = 10;
int count = (int)self.footerView.takePhotoView.allImages.count + 1;
int k ;
if (count % 2 == 0) {
k = count / 2;
} else {
k = (count + 1) / 2;
}
self.footerView.takePhotoView.frame = CGRectMake(0, 40, kScreenWidth, k * btnH + (k + 1) * marginY);
self.footerView.height = self.footerView.takePhotoView.frame.size.height + 220;
} }
- (void)createImagePicker - (void)createImagePicker
{ {
// 创建相册 if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
UIImagePickerController *pc = [[UIImagePickerController alloc] init]; UIAlertView* alert = [[UIAlertView alloc] initWithTitle:nil message:@"Unable to find the camera" delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
pc.allowsEditing = YES; [alert show];
pc.delegate = self; } else {
// 推出 UIImagePickerController *picker = [[UIImagePickerController alloc] init];
[self presentViewController:pc animated:YES completion:nil]; picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;
picker.videoQuality = UIImagePickerControllerQualityTypeLow;
[self presentViewController:picker animated:YES completion:nil];
}
} }
- (void)takePhotoShowPicture:(UIButton *)btn - (void)takePhotoShowPicture:(UIButton *)btn
...@@ -93,7 +109,7 @@ ...@@ -93,7 +109,7 @@
#pragma mark - UIImagePickerController 代理方法 #pragma mark - UIImagePickerController 代理方法
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{ {
UIImage *image = [info objectForKey:UIImagePickerControllerEditedImage]; UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
// 创建一个新的控件 // 创建一个新的控件
UIButton *newButton = [self.footerView.takePhotoView createButtonWithImage:image]; UIButton *newButton = [self.footerView.takePhotoView createButtonWithImage:image];
...@@ -114,7 +130,6 @@ ...@@ -114,7 +130,6 @@
CGFloat marginY = 10; CGFloat marginY = 10;
self.footerView.takePhotoView.frame = CGRectMake(0, 40, kScreenWidth, k * btnH + (k + 1) * marginY); self.footerView.takePhotoView.frame = CGRectMake(0, 40, kScreenWidth, k * btnH + (k + 1) * marginY);
self.footerView.height = self.footerView.takePhotoView.frame.size.height + 220; self.footerView.height = self.footerView.takePhotoView.frame.size.height + 220;
NSLog(@"self.footerView = %f", self.footerView.frame.size.height);
// 退出图片选择控制器 // 退出图片选择控制器
[picker dismissViewControllerAnimated:YES completion:nil]; [picker dismissViewControllerAnimated:YES completion:nil];
} }
......
...@@ -121,7 +121,6 @@ ...@@ -121,7 +121,6 @@
self.tableView.tableHeaderView = self.headView; self.tableView.tableHeaderView = self.headView;
// //
[self requestRankingList]; [self requestRankingList];
// 巡检列表 // 巡检列表
......
...@@ -127,7 +127,6 @@ ...@@ -127,7 +127,6 @@
return; return;
} }
HttpClient *httpClient = [[HttpClient alloc] initWithLogin]; HttpClient *httpClient = [[HttpClient alloc] initWithLogin];
UIWindow *window = [[UIApplication sharedApplication].windows lastObject]; UIWindow *window = [[UIApplication sharedApplication].windows lastObject];
[MBProgressHUD showHUDAddedTo:window animated:YES]; [MBProgressHUD showHUDAddedTo:window animated:YES];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment