swift - 如果我们在 Parchment 的 HeaderExample 中替换 UIView 而不是 UIImageView,则渐变背景不起作用
问题描述
我在我的应用程序中使用羊皮纸库进行分页。当我在 Parchment 的标题示例中将 UIImageView 替换为 UIView 时,渐变背景不起作用。我只看到白屏。
如果我在视图中单独添加渐变效果,使用羊皮纸,我相信它被某些层重叠。我也试过这个链接但没有用。 https://github.com/rechsteiner/Parchment/issues/181
实际结果是标题视图中的白屏,预期是渐变填充。
解决方案
The UIImageView.... if the gradient is being displayed as a bitmap in the .image of the UIImageView, that would explain the gradient disappearing.
UIView’s do not have a .image - That is why UIImageViews are needed to display bitmaps.
推荐阅读
- gps - NMEA输出中的ublox GPS奇怪字符
- android - Flutter 应用恢复;当活动被系统杀死时如何保存应用程序状态?
- mysql - MySQL GROUP BY,同时按列内容保留某些行
- mobile - 创建我的 CodeIgniter 网站的移动版本
- java - 将新字符[]语句中的字符[]数组作为括号中的参数传递,并将字符保存到新对象中
- c++ - 递减 std::vector::begin 是否未定义,即使从未使用过?
- r - 跨列加速计算
- html - 在表格html中将文本与右侧对齐
- excel - DAX 在获取仅包含数字的单元格时计算列的平均值
- javascript - 当文本框不为空或有值时禁用下拉菜单