如何在UIButton上动态设置不同的字体?
答
UIButton *button = [UIButton buttonWithType: UIButtonTypeRoundedRect];
button.titleLabel.font = [UIFont fontWithName:@"font name" size:12];
答
[tmp setFont:[UIFont fontWithName:@"American Typewriter" size:18]];
的字体名称把它从一个数组和不断变化的指数。
所以它看起来像
[tmp setFont:[UIFont fontWithName:[fontArray objectAtIndex:desiredIndex] size:18]];
setfont程序已经过时,它不是working.Do您有任何替代解决方案请。 – 2011-02-16 09:57:13