transparent UITextView

后端 未结 7 1834
长情又很酷
长情又很酷 2021-02-04 02:49

How do I make a UITextView transparent? I built the view in Interface Builder and placed a UITextView into it and it covers the background.

Any ideas?

相关标签:
7条回答
  • 2021-02-04 03:31

    For those who are looking for the simple answer please see the screenshot. Select TextView, change the Background property in the Attributes Inspector to "Clear Color"

    0 讨论(0)
  • 2021-02-04 03:32

    Change background color, and use opacity slider to make it fully transparent.

    Programmatically:

    textView.backgroundColor = [UIColor clearColor];
    
    0 讨论(0)
  • 2021-02-04 03:38

    In Xcode 4 use interface builder and choose Background as Default

    0 讨论(0)
  • 2021-02-04 03:40

    Swift 4.2

    txtView.backgroundColor = .clear
    
    0 讨论(0)
  • 2021-02-04 03:47

    If you are in the Interface Builder: Press cmd+1 to get to the Attributes Instructor pane

    Scroll down to the section "View" And click at Background the two Arrows - there u can choose now between several kinds of colorization. In this case "Clear Color"

    0 讨论(0)
  • 2021-02-04 03:55

    Up to iOS 4.3 You had to do the Interface Builder version of setting the background opacity. But as of iOS 5, you can set the backgroundColor and it will work. Just keep in mind when making apps for older OS versions.

    0 讨论(0)
提交回复
热议问题