Matthew Pateman
Matthew Pateman

Reputation: 1009

transparent UITextView

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?

Upvotes: 23

Views: 16569

Answers (7)

Arkady
Arkady

Reputation: 3232

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"

Attributes Inspector

Upvotes: 0

Yucel Bayram
Yucel Bayram

Reputation: 1663

Swift 4.2

txtView.backgroundColor = .clear

Upvotes: 2

mad_greasemonkey
mad_greasemonkey

Reputation: 894

for Swift 4

textView.backgroundColor = UIColor.clear

Upvotes: 0

HotJard
HotJard

Reputation: 4818

In Xcode 4 use interface builder and choose Background as Default

Upvotes: 3

Darkin
Darkin

Reputation: 221

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.

Upvotes: 3

user413280
user413280

Reputation: 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"

Upvotes: 0

mvds
mvds

Reputation: 47104

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

Programmatically:

textView.backgroundColor = [UIColor clearColor];

Upvotes: 55

Related Questions