Iphone 拇指指甲画廊?

Iphone 拇指指甲画廊?,iphone,objective-c,cocoa-touch,Iphone,Objective C,Cocoa Touch,嗨,我很好奇我将如何实现一个类似于iPhone照片应用程序的视图(见下文)。我最初的想法是一个表格视图,每个单元格有4张图片,有人能给我指出正确的方向吗。我对使用苹果的API特别感兴趣,所以在现阶段不要太在意第三方API/控制器 我建议。这是用于构建Facebook iPhone应用程序的API,它包含大量UI元素,包括许多照片管理UI 缩略图查看器看起来像(从其站点): 我建议。这是用于构建Facebook iPhone应用程序的API,它包含大量UI元素,包括许多照片管理UI 缩略图查看器看

嗨,我很好奇我将如何实现一个类似于iPhone照片应用程序的视图(见下文)。我最初的想法是一个表格视图,每个单元格有4张图片,有人能给我指出正确的方向吗。我对使用苹果的API特别感兴趣,所以在现阶段不要太在意第三方API/控制器

我建议。这是用于构建Facebook iPhone应用程序的API,它包含大量UI元素,包括许多照片管理UI

缩略图查看器看起来像(从其站点):

我建议。这是用于构建Facebook iPhone应用程序的API,它包含大量UI元素,包括许多照片管理UI

缩略图查看器看起来像(从其站点):


是的,正如您所说,表视图可以工作,4件事(/row)中的每一件事都是一个带有自定义图像的UIButton。但是,您必须确保表格行本身不可选择。()如果要有很多行,请确保使用表视图单元格缓存


实际的表视图单元格可以是UITableViewCell子类,也可以只是普通的一个子类,并将一些子视图添加到其contentView中。

是的,正如您所说,表视图可以工作,4个事物(/row)中的每一个都是带有自定义图像的UIButton。但是,您必须确保表格行本身不可选择。()如果要有很多行,请确保使用表视图单元格缓存


实际的表视图单元格可以是UITableViewCell子类,也可以只是普通的子类,并在其contentView中添加了一些子视图。

在iOS上,这项工作主要是为您完成的。查看苹果的文档中是否有MPMediaPickerController

在iOS上,这项工作主要是为您完成的。查看苹果的文档中是否有MPMediaPickerController

是自由和开放源码软件,用于许多引人注目的应用程序,如Kobo reader和Netflix Actors。

是自由和开放源码软件,用于许多引人注目的应用程序,如Kobo reader和Netflix Actors。

您需要使用UIScrollView和一组UIImageView或UIButton(图像作为背景图像)。此代码使用滚动视图上的按钮。此外,u wud还需要一个函数来生成缩略图,除非您使用资产库,在这种情况下,该函数已经存在

    [scrollview setContentSize:CGSizeMake(320, (items*itemWidth)];

    for (int i = 0; i < [items count]; i++) {

        if (i % 4 == 0) {

            y+=1;
            x = 0;
        }


        UIButton *myButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [myButton setBackgroundImage:[UIImage imageWithCGImage:[items objectAtIndex:i]] forState:UIControlStateNormal];
        CGRect rect2 = myButton.frame;
        rect2.size.height = kScrollObjHeight2;
        rect2.size.width = kScrollObjWidth2;
        rect2.origin.y = 10 + (y * 70) + (y *5);
        rect2.origin.x = 8 + (x * kScrollObjWidth2) + (x *8);
        myButton.frame = rect2;
        myButton.tag = i;   // tag our images for later use when we place them in serial fashion
        x = x + 1;


        [myButton addTarget:self action:@selector(clickFunction:) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:myButton];


        [scrollview addSubview:myButton];

    }

};


[scrollview setBackgroundColor:[UIColor blackColor]];
[scrollview setCanCancelContentTouches:NO];
scrollview.indicatorStyle = UIScrollViewIndicatorStyleWhite;
scrollview.clipsToBounds = YES;     // default is NO, we want to restrict drawing within our scrollview
scrollview.scrollEnabled = YES;

scrollview.pagingEnabled = YES;
[scrollview setContentSize:CGSizeMake(320,(items*itemWidth)];
对于(int i=0;i<[项目计数];i++){
如果(i%4==0){
y+=1;
x=0;
}
UIButton*myButton=[UIButton按钮类型:UIButtonTypeCustom];
[myButton setBackgroundImage:[UIImage imageWithCGImage:[items objectAtIndex:i]]用于状态:UIControlStateNormal];
CGRect rect2=myButton.frame;
rect2.size.height=kScrollObjHeight2;
rect2.size.width=kScrollObjWidth2;
rect2.origin.y=10+(y*70)+(y*5);
rect2.origin.x=8+(x*kScrollObjWidth2)+(x*8);
myButton.frame=rect2;
myButton.tag=i;//标记图像,以便以后以串行方式放置图像时使用
x=x+1;
[myButton addTarget:self action:@selector(clickFunction:)for ControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:myButton];
[滚动视图添加子视图:myButton];
}
};
[scrollview setBackgroundColor:[UIColor blackColor]];
[滚动视图设置CancelContentTouches:否];
scrollview.indicatorStyle=UIScrollViewIndicatorStyleWhite;
scrollview.clipsToBounds=YES;//默认值为NO,我们希望在scrollview中限制绘图
scrollview.scrollEnabled=是;
scrollview.PaginEnabled=是;

您需要使用UIScrollView和一组UIImageView或UIButton(以图像作为背景图像)。此代码使用滚动视图上的按钮。此外,您还需要一个函数来生成缩略图,除非您使用的是资产库,在这种情况下,该函数已经存在

    [scrollview setContentSize:CGSizeMake(320, (items*itemWidth)];

    for (int i = 0; i < [items count]; i++) {

        if (i % 4 == 0) {

            y+=1;
            x = 0;
        }


        UIButton *myButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [myButton setBackgroundImage:[UIImage imageWithCGImage:[items objectAtIndex:i]] forState:UIControlStateNormal];
        CGRect rect2 = myButton.frame;
        rect2.size.height = kScrollObjHeight2;
        rect2.size.width = kScrollObjWidth2;
        rect2.origin.y = 10 + (y * 70) + (y *5);
        rect2.origin.x = 8 + (x * kScrollObjWidth2) + (x *8);
        myButton.frame = rect2;
        myButton.tag = i;   // tag our images for later use when we place them in serial fashion
        x = x + 1;


        [myButton addTarget:self action:@selector(clickFunction:) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:myButton];


        [scrollview addSubview:myButton];

    }

};


[scrollview setBackgroundColor:[UIColor blackColor]];
[scrollview setCanCancelContentTouches:NO];
scrollview.indicatorStyle = UIScrollViewIndicatorStyleWhite;
scrollview.clipsToBounds = YES;     // default is NO, we want to restrict drawing within our scrollview
scrollview.scrollEnabled = YES;

scrollview.pagingEnabled = YES;
[scrollview setContentSize:CGSizeMake(320,(items*itemWidth)];
对于(int i=0;i<[项目计数];i++){
如果(i%4==0){
y+=1;
x=0;
}
UIButton*myButton=[UIButton按钮类型:UIButtonTypeCustom];
[myButton setBackgroundImage:[UIImage imageWithCGImage:[items objectAtIndex:i]]用于状态:UIControlStateNormal];
CGRect rect2=myButton.frame;
rect2.size.height=kScrollObjHeight2;
rect2.size.width=kScrollObjWidth2;
rect2.origin.y=10+(y*70)+(y*5);
rect2.origin.x=8+(x*kScrollObjWidth2)+(x*8);
myButton.frame=rect2;
myButton.tag=i;//标记图像,以便以后以串行方式放置图像时使用
x=x+1;
[myButton addTarget:self action:@selector(clickFunction:)for ControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:myButton];
[滚动视图添加子视图:myButton];
}
};
[scrollview setBackgroundColor:[UIColor blackColor]];
[滚动视图设置CancelContentTouches:否];
scrollview.indicatorStyle=UIScrollViewIndicatorStyleWhite;
scrollview.clipsToBounds=YES;//默认值为NO,我们希望在scrollview中限制绘图
scrollview.scrollEnabled=是;
scrollview.PaginEnabled=是;

通常这是一个很好的答案,但当他/她明确要求不要使用第三方解决方案或API时……我读到“在这个阶段不要太在意第三方API/控制器。”正如他不介意第三方API的建议。但对令人困惑的声明的进一步分析表明,您可能是正确的。:P哦,这可能会帮助将来的其他人知道它的存在。通常这是一个很好的答案,但当他/她明确要求不要第三方解决方案或API时……我读到了“在这个阶段,不要太在意第三方API/控制器。”正如他所说的,他并不在意第三方API。但进一步分析了令人困惑的统计数据