美文网首页
SwiftUI 渐变色, 字体, 圆环,

SwiftUI 渐变色, 字体, 圆环,

作者: yytmzys | 来源:发表于2023-05-28 00:59 被阅读0次

渐变圆环

Circle()
        .stroke(LinearGradient(gradient: Gradient(colors: [Color(.green), Color(.red)]), startPoint: .top, endPoint: .bottom), style: StrokeStyle(lineWidth: 3, lineCap: .round, lineJoin: .round)
                  )
        .frame(width: 140, height: 140)

字体渐变, foregroundStyle

Text("\(self.bpm)")
          .font(Font.system(size: 40))
          .foregroundStyle(
                LinearGradient(
                  colors: [.red, .green],
                  startPoint: .topLeading,
                  endPoint: .bottomTrailing
                )
              )
ZStack {
      // 821CED, E7166B
      Circle()
        .stroke(LinearGradient(gradient: Gradient(colors: [Color(.green), Color(.red)]), startPoint: .top, endPoint: .bottom), style: StrokeStyle(lineWidth: 3, lineCap: .round, lineJoin: .round)
                  )
        .frame(width: 140, height: 140)
      
      VStack {
        Text("BMP")
          .font(Font.system(size: 12))
          .foregroundColor(.white)
        
        Text("\(self.bpm)")
          .font(Font.system(size: 40))
          .foregroundStyle(
                LinearGradient(
                  colors: [.red, .green],
                  startPoint: .topLeading,
                  endPoint: .bottomTrailing
                )
              )
      }
截屏2023-05-29 00.59.07.png

相关文章

  • 渐变色圆环

    通过border-image来实现渐变色边框,但是border-image无法实现圆角,所以换一个思路:通过pad...

  • 如何设置字体和边框的渐变色

    字体渐变色主要由背景颜色设置,设置字体颜色为透明,背景色渐变。 边框渐变色使用css3的linear-gradie...

  • SwiftUI:渐变色

    SwiftUI为我们提供了三种可以使用的渐变,就像颜色一样,它们也是可以在我们的UI中绘制的视图。 渐变由以下几部...

  • SwiftUI学习(5)-Text

    Text的可定制参数 字体 通过.font方法可以设定Text字体swiftUI提供了众多的系统字体可用。 我们可...

  • Android自定义圆环进度控件

    HDCircleProgress 一个非常轻量级别的圆环进度控件,支持渐变色以及自定义属性 Github地址 ht...

  • iOS创建渐变色圆环

    需求 思路 用贝塞尔曲线来画圆淡黄色的一个圆弧,和表示进度的一条圆弧分开来画渐变色:找到进度圆弧的起点坐标和终点坐...

  • iOS 圆环渐变色动画

    先上图 思路 1.自定义view,在- (void)drawRect:(CGRect)rect方法中用贝塞尔曲线画...

  • iOS绘制渐变色圆环

    效果: 代码:

  • SwiftUI实现圆环进度条

    效果图

  • SwiftUI 教程 1.2 字体

    系统内置字体 SwiftUI 中的字体,具有动态缩放的特性: 在不同设备上会动态缩放 在支持动态类型的 App 中...

网友评论

      本文标题:SwiftUI 渐变色, 字体, 圆环,

      本文链接:https://www.haomeiwen.com/subject/lmbredtx.html