2012-01-03 9 views
0

私のアプリケーションでは、ユーザーがメモを入力できる大きなテキストフィールドがありますが、唯一の問題は設定した背景イメージに混ざらないということです。 UITextFieldを使用すると、Interface Builderで境界線を設定して、白い背景を持たないようにすることができます。透明な背景があり、バックグラウンドをバックグラウンドで表示します。私はUITextViewでこのボーダーオプションを見ていない、誰も私は同じ効果を達成する方法を知っていますか? (私はXcode 4.2を使っています)。UITextView問題

ありがとうございました!

+0

「ボーダー幅」と「ボーダーカラー」が優れています。 –

答えて

2

Interface Builderで背景の不透明度を変更できます。

Text View with background

Select it and change the background colour

Slide the opacity slider to make the background transparent.

+0

+1写真を投稿する時間を取るため – esqew

+0

すごくお世話になりました。 – John

+0

問題ありません!私は助けてうれしい! –

2

あなたはUITextViewに境界線を追加したい場合は、その後、

UITextView* myTextView = [[UITextView alloc] initWithFrame:CGRectMake(0,0,280,180)]; 
[myTextView setBackgroundColor:[UIColor clearColor]]; 

を使用することができますUITextViewに透明に背景を設定するにはあなたは、それをあなたの後に行うことができるtextViewのレイヤーに追加する必要があります

[[myTextView layer] setCornerRadius:15.0f]; //You don't need to set this but it will give the view rounded corners. 
[[myTextView layer] setBorderWidth:1.0f]; //again you pick the value 1 is quite a thin border 
[[myTextView layer] setBorderColor:[[UIColor blackColor] CGColor]]; //again you can choose the color. 

私はあなたの両方の質問に答える必要があります。あなたはコード -

#import <QuartzCore/QuartzCore.h> 

.... 


textView.layer.borderWidth = 5.0f; 
textView.layer.borderColor = [[UIColor grayColor] CGColor]; 

次使用することができます

2

はあなたの必要性ごとに色や境界線の幅を決めます。

関連する問題