推 kiii210:(2) 沒有文字,動態算出來height不就是0嗎? 01/13 13:09
→ issuemylove:(2) 的話我是用固定高度@@||| 01/13 13:34
→ issuemylove:因為1) 2) 3) 的間距要保持固定,但我從xib不了解要 01/13 13:35
→ issuemylove:怎樣設定才會達成這樣的條件QQ 01/13 13:36
→ issuemylove:我是用autolayout @@ 01/13 14:05
我後來在 cell 裡的 layoutSubviews 給覆寫
-(void) layoutSubviews{
self.動態文字.frame = CGRectMake(x,x,x,x);
}
結果也沒反應@@|||
※ 編輯: issuemylove 來自: 211.21.125.247 (01/13 16:07)
→ s8911124:- (CGFloat)tableView:(UITableView *)tableView 01/13 17:29
→ s8911124:heightForRowAtIndexPath:(NSIndexPath *)indexPath 01/13 17:30
→ s8911124:決定cell的高度 01/13 17:30
這個我知道@@ 主要是因為它有兩個變動長度
height我是算得出來
但我不知道要怎樣做設定 (依序畫出動態圖片、動態文字)
我最剛開始用 xib 但aotolayout我不知道要怎樣設定 弄不好orz
※ 編輯: issuemylove 來自: 211.21.125.247 (01/13 17:51)
後來我發現光是 image就很難把它固定位置
┌─────────┐
│┌───────┐│
││ 圖片高度動態 ││
│└───────┘│
│ │
...
└─────────┘
我主要是設定了 (a) pin -> Leading space to superview
(b) pin -> trailing space to superview
(c) pin -> top space to superview
因為高度不固定,所以我沒設定
但也因此出現了warning: Ambiguous layout: height is ambiguous for image view.
可是就高度不固定啊~"~
這樣要怎樣解決呢QQ|||
阿 找到這一篇有解答
http://forums.macrumors.com/showthread.php?t=1489373
※ 編輯: issuemylove 來自: 211.21.125.247 (01/13 19:34)
※ 編輯: issuemylove 來自: 211.21.125.247 (01/13 19:39)