2011-12-27 68 views
0

我有一個UITextView,我需要在「點形式」中添加一些文本。事情是這樣的:添加文本到UITextView

- > text 1 

- > text 2 

- > text 3 

- > text 4 

我的代碼:

UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 320, 400)]; 
[self.view addSubView:textView]; 

如果我有一個像text 1 text 2 text 3 text 4一個字符串,我怎麼能在UITextView的那些子彈跡象顯示呢?

+2

這個問題已經在這裏找到答案: HTTP://計算器。 com/questions/3798930/iphone-bullet-point-list – Kompi 2011-12-27 15:39:05

+1

如果您閱讀答案,您會注意到應用商店會拒絕提供的解決方案。無論如何謝謝 – sharon 2011-12-27 15:45:08

回答

0

我想你可以只使用

textview.text = yourString; 
    [textview.text stringByAddingPercentEscapesUsingEncoding:'TheRightTextEndoder']; 

後記你應該把一個正確的textencoding使得bullit將顯示

+0

'TheRightTextEndoder'是什麼?它有什麼作用 ? – sharon 2011-12-27 15:45:38