代码之家  ›  专栏  ›  技术社区  ›  fuzzygoat

指甲库?

  •  1
  • fuzzygoat  · 技术社区  · 15 年前

    alt text

    5 回复  |  直到 15 年前
        1
  •  1
  •   Community Mohan Dere    8 年前

    是的,正如您所说,一个表视图可以工作,4个东西(/row)中的每一个都是一个带有自定义图像的ui按钮。但是,您必须确保表行本身是不可选择的。( UITableView Setting some cells as "unselectable"

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

        2
  •  0
  •   MarkPowell    15 年前

    Three20 API . 这是用于构建Facebook iPhone应用程序的API,它有非常大的UI元素集合,包括许多照片管理UI。

    缩略图查看器看起来像(从他们的站点):

    alt text

        3
  •  0
  •   NSResponder    15 年前

    MPMediaPickerController .

        4
  •  0
  •   Dave DeLong    15 年前

    AQGridView 是自由和开放源码软件,用于许多高知名度的应用程序,如Kobo阅读器和Netflix Actors。

        5
  •  0
  •   Jinah Adam    15 年前

    您需要使用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;