如何增加UIImagePickerViewController的单元格高度

时间:2011-09-23 15:33:41

标签: iphone objective-c ipad

您好我有ImagePickerViewController我需要增加单元格的高度看起来像tableview,我需要增加imagePickerviewController的单元格高度。

I hope every one can understand my question.

i am attaching the picture 

enter image description here

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

    // Override point for customization after application launch.

    // Add the navigation controller's view to the window and display.
    UIImagePickerController *albumPicker = [[UIImagePickerController alloc]init];
    [albumPicker setDelegate:self];
    [albumPicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
    [albumPicker setContentSizeForViewInPopover:CGSizeMake(300, 700)];

    [self.window addSubview:albumPicker.view];
    [self.window makeKeyAndVisible];

    return YES;
}

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
    UINavigationItem *ipcNavBarTopItem;

    // add done button to right side of nav bar
    UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Photos"
                                                                   style:UIBarButtonItemStylePlain 
                                                                  target:self 
                                                                  action:@selector(saveImages:)];

    UINavigationBar *bar = navigationController.navigationBar;
    [bar setHidden:NO];
    ipcNavBarTopItem = bar.topItem;
    ipcNavBarTopItem.title = @"Photos";
    ipcNavBarTopItem.rightBarButtonItem = doneButton;
}

对于给定的图片是UIImagePicker我需要增加其单元格高度。

我试试运气。任何人都可以帮助我。

2 个答案:

答案 0 :(得分:0)

显然是UITableView。可以在UITableView的rowHeight属性上设置所有单元格的高度,也可以在UITableViewDelegate的heightForRowAtIndexPath方法中为每个单元格单独设置高度。查看您的资源,了解UITableView的设置位置。

答案 1 :(得分:0)

要增加TableView单元格的高度,请执行以下方法:

- (CGFloat)tableView:(UITableView *)tv
    heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    CGFloat height;
    height = 44;
    return height;

}