こんにちは私はTwitterで作業しています。画像に問題があります。ツイートの表示にUITableviewがあります。ツイートにはユーザー写真が入っています。 私はUITableviewをスクロールすると非常にゆっくりとスクロールします。写真のメモリサイズを減らして、スクロールすることを提案してください。iPhone:ピクチャのメモリサイズを減らす方法
私はサムネイルはそれをしない、メモリサイズを小さくすることができます聞いた。このコードでそれを行う方法もしそうなら(私は選択して、どのようなサムネイル方法を行う者のために持っている方法ではない場合)(テーブルビューセルコード)
//Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *identifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
if(!cell) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewStyleGrouped reuseIdentifier:nil] autorelease];
UIImageView *myImage = [[UIImageView alloc]initWithFrame:CGRectMake(6,10,58,60)] ;
NSURL *url = [NSURL URLWithString:[(Tweet*)[tweetArray objectAtIndex:indexPath.row] image_url]]; //here Tweet is other class and image_url is method in the Tweet class
NSData *data = [[NSData alloc] initWithContentsOfURL:url];
[myImage setImage: [UIImage imageWithData:data]];
[cell.contentView addSubview:myImage];
[myImage release];
}
return cell;
}
は、(スレッドなしでテーブルのイメージをダウンロードしてください)
くれ
コードを強調するために、あなたの投稿を編集してください。このように読むのは不可能です。 –