UILabel多行文本,带有文本渐变alpha

时间:2019-02-21 21:27:29

标签: ios swift uilabel

我正在尝试通过编码实现以下目标。

Image to achieve

我已经使用UILabel及其以编程方式完成

    descriptionTitleLabel.text = "Description"

    addSubview(descriptionTitleLabel)

    descriptionText.text = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
    descriptionText.numberOfLines = 3
    descriptionText.textColor = UIColor.GrayColor
    addSubview(descriptionText)

    readMoreLabel.text = "Read more +"

以下代码显示如下

What i have achieved

我不确定如何实现第一个图像所示的文本淡入淡出。

感谢您抽出宝贵的时间。

0 个答案:

没有答案