簡體   English   中英

iPhone SDK簡單問題

[英]iPhone SDK Simple Question

是否可以在UITableViewCell的左側添加UIActivityIndi​​catorView? 我們已經在使用UITableViewCell的右側作為公開指示器。

謝謝。

當然。 只需實例化一個UIActivityIndi​​catorView,為其提供一個.frame即可將其設置在所需位置,將其添加為cell.contentView的子視圖,然后調用startAnimating

UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] 
    initWithFrame:CGRectMake(0,0,20,20)]; //or whatever--this will put it in the top left corner of the cell
[cell.contentView addSubview:spinner]
[spinner startAnimating];
[spinner release];

如果創建自定義單元,則可以執行任何操作。 但是,Apple提供的這份文檔應該為您提供所有所需的條件,無論是將子視圖添加到常規的舊UITableViewCell還是創建自己的子視圖。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM