2017-08-24 122 views
1

大家好,任何人都可以幫助我們瞭解如何使用Swift語言或故事板在Xcode中更改UITextView的光標閃爍顏色。如何在Xcode中更改UITextView光標閃爍顏色

+0

集Tintcolor您的UITextView –

+1

@NishantBhindi都可以在色調影響的文本顏色? –

+0

不受影響@malik –

回答

0

只是改變色調顏色

UITextView.appearance().tintColor = .black 

的Objective-C:

[[UITextView appearance] setTintColor:[UIColor blackColor]]; 
0

要做到這一點在情節串連圖板,這樣做

enter image description here

設置Tint到您想要的顏色。

2

斯威夫特4時,Xcode 9.1測試版

我試着設置我的UITextView的tintColor在界面生成器,但沒有爲我工作。我不知道爲什麼,但我的UITextView設置tintColor一種顏色,然後將其重置爲顏色我真的很想爲我工作...

myUITextView.tintColor = .anySystemColor 
myUITextView.tintColor = .theColorYouReallyWant 
0

我試着設置TextView的文本框,並在tintColor故事板。 TextField光標改變了顏色,但textView沒有改變顏色。

它幫助我旁邊:

let redTintColor: UIColor = UIColor.red 

override func awakeFromNib() { 
    super.awakeFromNib() 

    textView.tintColor = redTintColor 
} 

let redTintColor: UIColor = UIColor.red 

override func awakeFromNib() { 
    super.awakeFromNib() 

    textView.tintColor = redTintColor 
    textView.tintColorDidChange() 
}