Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 |
Tags
- GIT
- PyQt
- swift
- javascript
- 라즈베리파이
- IOS
- 맛집
- Linux
- PER
- flutter
- urllib
- ASP
- 리눅스
- pandas
- 날짜
- 함수
- ubuntu
- PyQt5
- Excel
- MySQL
- node.js
- tensorflow
- sqlite
- python
- 다이어트
- MS-SQL
- Unity
- 유니티
- port
- mssql
Archives
아미(아름다운미소)
이미지가 더 작은 경우에도 UITableViewCell의 ImageView를 고정 크기로 만드는 방법 본문
UITableViewCell의 ImageView를 고정
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
...
cell.imageView?.image = myImage
let itemSize = CGSize(width:42.0, height:42.0)
UIGraphicsBeginImageContextWithOptions(itemSize, false, 0.0)
let imageRect = CGRect(x:0.0, y:0.0, width:itemSize.width, height:itemSize.height)
cell.imageView?.image!.draw(in:imageRect)
cell.imageView?.image! = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()
}
'랭귀지 > SWIFT' 카테고리의 다른 글
| UITableViewCell 선택 스타일을 사용하지 않도록 설정 (0) | 2018.05.21 |
|---|---|
| UITextField 또는 UITextView 문자 수를 제한하는 방법 (4) | 2018.05.20 |
| swift UIColor에 RGBA 값 적용하기 (0) | 2018.05.17 |
| 리눅스에서 swap 메모리 초기화 (0) | 2018.05.16 |
| iOS TableView의 Cell 선택 효과 제거하기 (0) | 2018.05.14 |
Comments