質問

I would like to create a tag cloud of sorts, and I thought of using a UITextView. Is it possible to have variable text sizes in a UITextView? If not, any other suggestions on which UI elements to use to generate a tag cloud?

役に立ちましたか?

解決

I would recommend programmatically adding UILabel objects as needed. You can only have one font size per UITextView, plus UITextView is generally for editable text. Just roughly, you could use something like this:

 UILabel *example = [[UILabel alloc] initWithFrame:<#(CGRect)#>];
 [example setFont:<#(UIFont *)#>];
 [example setText:<#(NSString *)#>];
 [self.view addSubview:example];

You can put it in a loop and fill in the blanks.

他のヒント

It should be possible in iOS 6 (if you can wait that long) since Apple is finally adding the possibility to use NSAttributedString in UITextView.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top