ios - 如何在 swift iOS 中创建类似于 spotify 的均衡器 UI 的 UI
问题描述
你好,我是 iOS 新手,对创建复杂的 UI 没有太多想法,我想创建像 spotify 的均衡器 UI 一样的均衡器 UI。目前我已经使用 UISlider 设置了我的均衡器。我应该使用什么来修改我的 UI,例如 spotify 的 EQ UI。如果您可以帮助使用示例代码,那就太好了。谢谢你。
解决方案
The approach could be simple:
- Make the color of your sliders gauges clear so they are transparent
- Read the values of your sliders and draw lines between them
- Create a polygon with the coordinates of your sliders values + the two points at the bottom and fill it with a color gradient
As your sliders are equally spaced you can deduce their x position knowing the width of the graph container, the y value is the slider current value + some correction with the slider button size.
推荐阅读
- exception - SNAPSHOT_SERIALIZATION_ERROR 重复的属性 JaVers
- sql - 程序内的 Redshift 美元报价
- google-cloud-platform - 创建数据过程集群时出错.. 对 cloud.projects.get 的权限被拒绝
- typescript - TypeScript:密钥索引签名仅适用于所有未定义的属性
- javascript - 如何使用 Mocha 测试 Vue.js 中的 DOM 更新?
- python - 如何使用不影响 Tkinter GUI 的特定“if”条件终止 Python 脚本?
- mysql - 在 Spring Boot 中运行测试时启动临时 mysql 容器
- node.js - MongoDb 使用动态查询对象查找
- python - Python - 获取数据框列的各个元素
- linux - SMP 关联路由不适用于 ARM 上的 GICv2