---
title: "ios 修改UITextView的placeholder的颜色"
author: "2014马年"
date: "2016-04-01T18:38:41Z"
tags: []
categories: ["移动开发"]
slug: "ios-uitextview-placeholder"
draft: false
lastmod: "2016-04-01T18:38:41Z"
id: 2288087
url: "https://20142014.iteye.com/blog/2288087"
---

问题解决地址：

 

http://stackoverflow.com/questions/26076054/changing-placeholder-text-color-with-swift

 

1.如下图，加入 **\_placeholderLabel.textColor**

![](http://i.stack.imgur.com/3K0tn.png)

 

 

2.使用代码

```
textFld.attributedPlaceholder =NSAttributedString(string:"Test Data for place holder", attributes:[NSForegroundColorAttributeName:UIColor.blueColor(),NSFontAttributeName:UIFont(name:"Arial", size:10)!])
```

` `