AQGridView を使用して、約 21 項目の画像ギャラリーを作成しています。アプリのロゴと名前を含むビューをこのリスト/スクロールビューの一番上に追加して、ユーザーがそれを見るようにしたいのですが、スクロールして画像を見ると、名前とロゴのあるビューが一緒にスクロールします。誰かが前にこのようなものを実装しましたか?
@skram のおかげでロゴを追加することができましたが、今では画像が画像の最初の行をブロックしています。
ここで、ロゴを定義して gridView に追加します。
self.gridView = [[AQGridView alloc] initWithFrame:CGRectMake(0, 0, 320, 367)];
UIImageView *logo = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"paramythLogoTest.png"]];
[logo setFrame:CGRectMake(0,0,logo.frame.size.width,logo.frame.size.height)];
[gridView addSubview:logo];
self.gridView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
self.gridView.autoresizesSubviews = YES;
self.gridView.delegate = self;
self.gridView.dataSource = self;
[self.view addSubview:gridView];
[self.gridView reloadData];
次に、画像がここにロードされます。
- (AQGridViewCell *) gridView: (AQGridView *) aGridView cellForItemAtIndex: (NSUInteger) index
{
static NSString * PlainCellIdentifier = @"PlainCellIdentifier";
GridViewCell * cell = (GridViewCell *)[aGridView dequeueReusableCellWithIdentifier:@"PlainCellIdentifier"];
if ( cell == nil )
{
cell = [[GridViewCell alloc] initWithFrame: CGRectMake(3.333, 3.333, 100, 100)
reuseIdentifier: PlainCellIdentifier];
}
NSString *stringURL = [[featuredStories objectAtIndex:index] objectAtIndex:1];
NSURL *url = [NSURL URLWithString:stringURL];
[cell.imageView setImageWithURL:url placeholderImage:[UIImage imageNamed:@"example0.png"]];
cell.storyID = [[featuredStories objectAtIndex:index] objectAtIndex:0];\
return cell;
}
シミュレーターのスクリーンショットは次のとおりです。