回答
只要將波紋管代碼白色背景
[yourTextField setBackgroundColor:[UIColor whiteColor]];
,或者如果想清除的顏色,然後婁代碼
[yourTextField setBackgroundColor:[UIColor clearColor]];
這麼簡單
:)
UITextField *yourTextField= [[UITextField alloc] initWithFrame:frame];
yourTextField.borderStyle = UITextBorderStyleNone;
[yourTextField setBackgroundColor:[UIColor clearColor]];
參考[自定義UITextField](http://www.roseindia.net/answers/viewqa/Mobile-Applications/15639-UITextField-Programmatically-iPhone.html) – Hector
是的,你可以做到這一點。
您可以通過設置透明度來設置透明度。您可以使用數字色彩表(它是Mac中的內置應用程序)來拍攝彩色代碼。
如果設置了alpha 1,那麼將不會有透明度。根據您的需要設置透明度(將alpha設置爲小於1)。
試試這個:
textfield.backgroundColor=[[UIColor colorWithRed:208.0/255.0 green:15.0/255.0 blue:202.0/255.0 alpha:0.6] CGColor];
嘿朋友,如果你想背景透明或清除setBackground的顏色clearColor只有一個簡單的線代碼夥計...喜歡.. [yourTextField setBackgroundColor:[UIColor clearColor]]; :) –
@ParasJoshi您對使用clearColor的簡單性是正確的,但這仍然是一個很好的例子。這個答案是提問者基本顏色操作的一個很好的總結。爲你們兩個+1! –
您可以在Xamarin下文提到的代碼中設置
txtNumber.BackgroundColor = UIColor.White;
txtNumber.Alpha = 0.5f;
參考文獻1:transparent UITextView 參考2:How do I create a transparent UITextField?
與之相似:
txtNumber .Bac kgroundColor = UIColor.Clear;
- 1. 文字透明度與黑色背景
- 2. 使文本字段背景透明,但佔位符文本不透明
- 3. 段落中的不透明度變化改變了文本的不透明度和背景不透明度
- 4. 不透明的背景,但沒有不透明度文本
- 5. 使段落背景透明而不透明文本
- 6. css背景透明度?
- 7. OpenGL背景透明度?
- 8. RemoteView背景透明度
- 9. PyQt4.QtWebKit +背景透明度
- 10. Libgdx fbo背景透明度
- 11. 透明背景進度條?
- 12. UIImageView背景/透明度
- 13. CSS背景透明度
- 14. 背景透明度問題
- 15. Android:ViewGroup背景透明度
- 16. 透明背景,明文?
- 17. 透明背景上的純文本
- 18. 從文本字段中移除圓角,保持背景不透明度iOS Swift
- 19. 背景圖像上的透明文字
- 20. 半透明背景上的文字
- 21. 透明背景
- 22. PHP產生半透明的背景顏色使用透明度影響文本
- 23. 使單元格的背景透明,不使文本透明
- 24. 樣式表具有帶不透明文本的透明背景?
- 25. 透明背景上的非透明輸入文本
- 26. 繪圖文本與透明背景
- 27. 透明文本允許背景顯示
- 28. 背景透明按鈕文本
- 29. 使用透明背景滾動文本
- 30. Pyglet文本背景不透明
你想要什麼背景顏色與清晰的顏色? –
是的確切我不想任何背景顏色 – Alippo
然後使用此代碼我粘貼代碼與ClearColor波紋見下面我clearColor的代碼:) –