嗨,我想在圖像中設置下面的UItextView的陰影。如何設置UItextview邊框的陰影?
我曾嘗試下面的代碼,但它並沒有給我同樣的結果,而這也使得他的UITextView的文本陰影。
self.tv_comments.layer.shadowRadius = 5.0
self.tv_comments.layer.borderColor = UIColor.gray.cgColor
self.tv_comments.layer.borderWidth = 1
self.tv_comments.layer.shadowColor = UIColor.gray.cgColor
self.tv_comments.layer.shadowOffset = CGSize(width: 2.0, height: 2.0)
self.tv_comments.layer.shadowOpacity = 1.0
self.tv_comments.textColor = UIColor.black
上面的代碼導致我這個觀點不要求
你可以嘗試用UIView包裝UITextView並設置UIView的陰影 –