1

画像をテーブルビューの幅いっぱいに表示するには、他に何が必要ですか?

UIImage *image = [UIImage imageNamed:@"balloon_2.png"]; 
[image stretchableImageWithLeftCapWidth:15 topCapHeight:13]; 
cell.image = image;
4

1 に答える 1

1

StretchableImageWithLeftCapWidth:topCapHeight: 新しい UIImage を返します。次のようなことをする必要があります

UIImage *image = [UIImage imageNamed:@"balloon_2.png"]; 
UIImage *strImage = [image stretchableImageWithLeftCapWidth:15 topCapHeight:13]; 
cell.image = strImage;

... または、メッセージの結果をすぐに cell.image に割り当てます。

参照: UIImage リファレンス

于 2009-08-18T22:14:47.170 に答える