ios在表格視圖單元格中視覺調整圖像大小 (ios visually resize image in a table view cell)


問題描述

ios在表格視圖單元格中視覺調整圖像大小 (ios visually resize image in a table view cell)

I am new to ios and am working on creating a table view with custom table view cell. I am running into a very simple problem. I am trying to resize an image visually within a custom table view cell (the table view cell content outlets are linked to a custom class). However, I am unable to resize either the labels or the image. Following screen shot is that of my storyboard view and the image. Any ideas if I am missing something? Thanks!


參考解法

方法 1:

You need to put the name of your custom class on Class property of TableViewCell like the image. If it does not work, let we know more about the code. 

方法 2:

Is this a Static Cell? If you have a UIImageView in your custom cell then you should be able to load the image and IOS will automatically size your image.

方法 3:

This may be a bug in my Xcode Version 5.0 (5A11365x. When I switch to Xcode 4.5.2, I am able to resize the labels. I am developing for ios 7.0. I will download the latest Xcode for ios 7 and see if that fixes the issue.

UPDATE Yes looks like it is an Xcode bug. I just installed latest Xcode Version 5.0 (5A1412) and it allows you to adjust the label and image sizes.

(by servermandjservatekstopserverman)

參考文件

  1. ios visually resize image in a table view cell (CC BY‑SA 3.0/4.0)

#imageview #resize #storyboard #iOS #uitableview






相關問題

Android imageview 未在 TableRow 中顯示 (Android imageview not displaying in TableRow)

Android中的手勢 (Gestures in Android)

GridView kéo dài ImageView không đồng nhất (GridView Stretching ImageView Non-Uniformly)

ios在表格視圖單元格中視覺調整圖像大小 (ios visually resize image in a table view cell)

IndoorAtlas SDK 2.0:使用 Picasso 和自定義 ImageView (IndoorAtlas SDK 2.0: Using Picasso with custom ImageView)

當圖像的寬度小於顯示器的寬度時,如何在視圖尋呼機內對齊圖像視圖的中心? (How to align center an image view inside a view pager when the image's width is less than the display's?)

正確旋轉 ImageView 和 FrameLayout (Rotate ImageView and FrameLayout correctly)

setOnClickListener 沒有在圖像視圖上被調用 (setOnClickListener is not getting called on image view)

Android:擴展 onTouchEvent 以進行拖動的 ImageView (Android: ImageView that extends onTouchEvent for Drag)

將旋轉的文本放在圖像視圖上 (Put rotated text on an imageview)

如何在底部設置圖像視圖 (how to set imageview in bottom)

我如何使用數組來顯示匹配的 Imageview? (How Could I use array to show match Imageview?)







留言討論