、2行のテキスト、およびオプションのアクセサリビューを提供するスタイルをUITableViewCell
使用して表示したい画像があります。UITableViewCellStyleSubtitle
UIImageView
ただし、のコンテンツモードをまたはのUIImageView
いずれかUIViewContentModeScaleAspectFit
に設定UIViewContentModeScaleAspectFill
すると、違いがないように見えます。これらのコンテンツモードはどちらも、画像全体を表示するだけで、テキストを右にシフトして画像用のスペースを確保します。
これらが実際にどのように異なるかについての例はありますか?ドキュメントによると:
UIViewContentModeScaleAspectFit:
Scales the content to fit the size of the view by maintaining the aspect ratio. Any remaining area of the view’s bounds is transparent.
UIViewContentModeScaleAspectFill:
Scales the content to fill the size of the view. Some portion of the content may be clipped to fill the view’s bounds.
ただし、これらのコンテンツモードは、宣伝どおりに動作していないようです。
編集:私はSDKiOS4を実行しています。