鸿蒙开发—黑马云音乐之Music页面

news2024/9/17 7:06:18

目录

1.外层容器效果

2.信息区-发光效果

3.信息区-内容布局

4.播放列表布局

5.播放列表动态化

6.模拟器运行并配置权限


效果:

1.外层容器效果

@Entry
@Component
export struct MuiscPage {
  build() {
    Column() {
      // 信息区域
      Column() {

      }
      .width('100%')
      // .backgroundColor(Color.Pink)
      .layoutWeight(1)

      // 播放列表
      Column() {

      }
      .width('100%')
      .backgroundColor('#ff333333')
      .layoutWeight(2)
      .borderRadius({topLeft:10,topRight:10})
    }
    .height('100%')
    .width('100%')
    .backgroundColor(Color.Black)
  }
}

外层布局就不多说了,使用column容器组件,再增加属性调整。

2.信息区-发光效果

 Column() {

      }
      .width('100%')
      // .backgroundColor(Color.Pink)
      .layoutWeight(1)
      .radialGradient({
        center:['90%','-10%'],  // 设置中心点
        radius:'150%',// 设置半径
        colors:[  //设置颜色的
          ['#5c4111',0.2],
          [Color.Transparent,1]  //Color.Transparent表示透明色
        ]
      })

使用径向渐变实现,可以自行设置背景色和中心点。

3.信息区-内容布局

@Entry
@Component
export struct MuiscPage {
  build() {
    Column() {
      // 信息区域
      Column({space:40}) {
        // 喜欢的音乐
        Row({space:10}) {
          Column() {
            Image($r('app.media.ic_favorite'))
              .width(80)
              .fillColor('#ff5286')
          }
          .justifyContent(FlexAlign.Center)
          .width(100)
          .height(100)
          .backgroundColor(Color.White)
          .borderRadius(10)

        // 文字信息
          Column({space:10}){
            Text('我喜欢的音乐')
              .fontColor(Color.White)
              .width('100%')
              .fontWeight(700)

            Text('黑马程序员')
              .fontColor('#ffb7b8ba')
              .width('100%')
              .fontSize(12)
          }
        }
        .width('100%')
        // 三个按钮
        Row() {
          Button({ type:ButtonType.Normal }){
            Row({space:10}){
              Image($r('app.media.ic_share'))
                .width(20)
                .fillColor('#d2577c')

              Text('分享').fontColor(Color.White)
                .fontSize(12)
            }
          }
          .backgroundColor('#ff363737')
          .width(90)
          .height(40)
          .borderRadius(20)

          Button({ type:ButtonType.Normal }){
            Row({space:10}){
              Image($r('app.media.ic_comment'))
                .width(20)
                .fillColor('#d2577c')

              Text('评论').fontColor(Color.White)   .fontSize(12)
            }
          }
          .backgroundColor('#ff363737')
          .width(90)
          .height(40)
          .borderRadius(20)

          Button({ type:ButtonType.Normal }){
            Row({space:10}){
              Image($r('app.media.ic_collect'))
                .width(20)
                .fillColor('#d2577c')

              Text('收藏').fontColor(Color.White)   .fontSize(12)
            }
          }
          .backgroundColor('#ff363737')
          .width(90)
          .height(40)
          .borderRadius(20)

        }
        .width('100%')
        .justifyContent(FlexAlign.SpaceBetween)
      }
      .padding({top:30,right:20,bottom:30,left:20})
      .width('100%')
      // .backgroundColor(Color.Pink)
      .layoutWeight(1)
      .radialGradient({
        center: ['90%', '-10%'], // 设置中心点
        radius: '150%', // 设置半径
        colors: [ // 设置颜色的
          ['#5c4111', 0.2],
          [Color.Transparent, 1] //Color.Transparent表示透明色
        ]
      })

      // 播放列表
      Column() {

      }
      .width('100%')
      .backgroundColor('#ff333333')
      .layoutWeight(2)
      .borderRadius({ topLeft: 10, topRight: 10 })
    }
    .height('100%')
    .width('100%')
    .backgroundColor(Color.Black)
  }
}

信息区域也只是简单的静态布局,图片从首页导航栏的资源下载。

4.播放列表布局

@Entry
@Component
export struct MuiscPage {
  build() {
    Column() {
      // 信息区域
      Column({ space: 40 }) {
        // 喜欢的音乐
        Row({ space: 10 }) {
          Column() {
            Image($r('app.media.ic_favorite'))
              .width(80)
              .fillColor('#ff5286')
          }
          .justifyContent(FlexAlign.Center)
          .width(100)
          .height(100)
          .backgroundColor(Color.White)
          .borderRadius(10)

          // 文字信息
          Column({ space: 10 }) {
            Text('我喜欢的音乐')
              .fontColor(Color.White)
              .width('100%')
              .fontWeight(700)

            Text('黑马程序员')
              .fontColor('#ffb7b8ba')
              .width('100%')
              .fontSize(12)
          }
        }
        .width('100%')
        // 三个按钮
        Row() {
          Button({ type: ButtonType.Normal }) {
            Row({ space: 10 }) {
              Image($r('app.media.ic_share'))
                .width(20)
                .fillColor('#d2577c')

              Text('分享').fontColor(Color.White)
                .fontSize(12)
            }
          }
          .backgroundColor('#ff363737')
          .width(90)
          .height(40)
          .borderRadius(20)

          Button({ type: ButtonType.Normal }) {
            Row({ space: 10 }) {
              Image($r('app.media.ic_comment'))
                .width(20)
                .fillColor('#d2577c')

              Text('评论').fontColor(Color.White).fontSize(12)
            }
          }
          .backgroundColor('#ff363737')
          .width(90)
          .height(40)
          .borderRadius(20)

          Button({ type: ButtonType.Normal }) {
            Row({ space: 10 }) {
              Image($r('app.media.ic_collect'))
                .width(20)
                .fillColor('#d2577c')

              Text('收藏').fontColor(Color.White).fontSize(12)
            }
          }
          .backgroundColor('#ff363737')
          .width(90)
          .height(40)
          .borderRadius(20)

        }
        .width('100%')
        .justifyContent(FlexAlign.SpaceBetween)
      }
      .padding({ top: 30, right: 20, bottom: 30, left: 20 })
      .width('100%')
      // .backgroundColor(Color.Pink)
      .layoutWeight(1)
      .radialGradient({
        center: ['90%', '-10%'], // 设置中心点
        radius: '150%', // 设置半径
        colors: [ // 设置颜色的
          ['#5c4111', 0.2],
          [Color.Transparent, 1] //Color.Transparent表示透明色
        ]
      })

      // 播放列表
      Column() {
        // 全部播放容器
        Row({ space: 5 }) {
          Image($r('app.media.ic_play'))
            .width(15)
            .fillColor('#d2577c')
          Text('播放全部(16)')
            .fontColor(Color.White)
            .fontSize(12)
        }
        .width('100%')
        .padding(10)

        //   歌曲列表
        List() {
          // 每一首歌曲的信息布局
          ListItem() {
            Row() {
              Text('1')
                .fontColor(Color.White)
                .width(30)
                .textAlign(TextAlign.Center)
              Row({space:10}) {
                Image('http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/0.jpg')
                  .width(30)
                  .borderRadius(5)
                Column() {
                  Text('直到世界的尽头')
                    .fontColor('#ff9fa0a1')
                    .fontSize(12)
                    .width('100%')

                  Text('WANDS')
                    .fontColor('#ff9fa0a1')
                    .fontSize(10)
                    .width('100%')
                }
              }
              .layoutWeight(1)

              Image($r('app.media.ic_more'))
                .fillColor(Color.White)
                .width(15)
            }
            .width('100%')
            .padding({top:8,bottom:8})
          }

          ListItem() {
            Row() {
              Text('4')
                .fontColor(Color.White)
                .width(30)
                .textAlign(TextAlign.Center)
              Row({space:10}) {
                Column() {
                  Text('麝香夫人')
                    .fontColor('#ff9fa0a1')
                    .fontSize(12)
                    .width('100%')

                  Text('凤凰传奇')
                    .fontColor('#ff9fa0a1')
                    .fontSize(10)
                    .width('100%')
                }
              }
              .layoutWeight(1)

              Image($r('app.media.ic_more'))
                .fillColor(Color.White)
                .width(15)
            }
            .width('100%')
            .padding({top:8,bottom:8})
          }
        }

      }
      .width('100%')
      .backgroundColor('#ff333333')
      .layoutWeight(2)
      .borderRadius({ topLeft: 10, topRight: 10 })
    }
    .height('100%')
    .width('100%')
    .backgroundColor(Color.Black)
  }
}

歌曲列表是两种格式,一种是排名前三的歌曲(带有歌曲图片),另一种是前三之外的歌曲(不带有歌曲图片),首先设置好这两种静态布局后才进入下一步。

5.播放列表动态化

export interface songItemType {
  img: string
  name: string
  author: string
  url: string
  id: string
}

@Entry
@Component
export struct MuiscPage {
  // 歌曲列表
  @State songs: songItemType[] = [
    {
      img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/0.jpg',
      name: '直到世界的尽头',
      author: 'WANDS',
      url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/0.m4a',
      id: '0000'
    },
    {
      img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/1.jpg',
      name: '画',
      author: '赵磊',
      url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/1.mp3',
      id: '0001'
    },
    {
      img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/2.jpg',
      name: 'Sweet Dreams',
      author: 'TPaul Sax / Eurythmics',
      url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/2.mp3',
      id: '0002'
    },
    {
      img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/3.jpg',
      name: '奢香夫人',
      author: '凤凰传奇',
      url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/3.m4a',
      id: '0003'
    },
    {
      img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/4.jpg',
      name: '空心',
      author: '光泽',
      url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/4.mp3',
      id: '0004'
    },
    {
      img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/5.jpg',
      name: '反转地球',
      author: '潘玮柏',
      url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/5.mp3',
      id: '0005'
    },
    {
      img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/6.jpg',
      name: 'No.9',
      author: 'T-ara',
      url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/6.m4a',
      id: '0006'
    },
    {
      img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/7.jpg',
      name: '孤独',
      author: 'G.E.M.邓紫棋',
      url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/7.m4a',
      id: '0007'
    },

    {
      img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/8.jpg',
      name: 'Lose Control',
      author: 'Hedley',
      url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/8.m4a',
      id: '0008'
    },
    {
      img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/9.jpg',
      name: '倩女幽魂',
      author: '张国荣',
      url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/9.m4a',
      id: '0009'
    },
    {
      img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/10.jpg',
      name: '北京北京',
      author: '汪峰',
      url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/10.m4a',
      id: '0010'
    },
    {
      img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/11.jpg',
      name: '苦笑',
      author: '汪苏泷',
      url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/11.mp3',
      id: '0011'
    },
    {
      img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/12.jpg',
      name: '一生所爱',
      author: '卢冠廷 / 莫文蔚',
      url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/12.m4a',
      id: '0012'
    },
    {
      img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/13.jpg',
      name: '月半小夜曲',
      author: '李克勤',
      url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/13.mp3',
      id: '0013'
    },
    {
      img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/14.jpg',
      name: 'Rolling in the Deep',
      author: 'Adele',
      url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/14.m4a',
      id: '0014'
    },
    {
      img: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/15.jpg',
      name: '海阔天空',
      author: 'Beyond',
      url: 'http://yjy-teach-oss.oss-cn-beijing.aliyuncs.com/HeimaCloudMusic/15.m4a',
      id: '0015'
    }
  ]

  build() {
    Column() {
      // 信息区域
      Column({ space: 40 }) {
        // 喜欢的音乐
        Row({ space: 10 }) {
          Column() {
            Image($r('app.media.ic_favorite'))
              .width(80)
              .fillColor('#ff5286')
          }
          .justifyContent(FlexAlign.Center)
          .width(100)
          .height(100)
          .backgroundColor(Color.White)
          .borderRadius(10)

          // 文字信息
          Column({ space: 10 }) {
            Text('我喜欢的音乐')
              .fontColor(Color.White)
              .width('100%')
              .fontWeight(700)

            Text('黑马程序员')
              .fontColor('#ffb7b8ba')
              .width('100%')
              .fontSize(12)
          }
        }
        .width('100%')
        // 三个按钮
        Row() {
          Button({ type: ButtonType.Normal }) {
            Row({ space: 10 }) {
              Image($r('app.media.ic_share'))
                .width(20)
                .fillColor('#d2577c')

              Text('分享').fontColor(Color.White)
                .fontSize(12)
            }
          }
          .backgroundColor('#ff363737')
          .width(90)
          .height(40)
          .borderRadius(20)

          Button({ type: ButtonType.Normal }) {
            Row({ space: 10 }) {
              Image($r('app.media.ic_comment'))
                .width(20)
                .fillColor('#d2577c')

              Text('评论').fontColor(Color.White).fontSize(12)
            }
          }
          .backgroundColor('#ff363737')
          .width(90)
          .height(40)
          .borderRadius(20)

          Button({ type: ButtonType.Normal }) {
            Row({ space: 10 }) {
              Image($r('app.media.ic_collect'))
                .width(20)
                .fillColor('#d2577c')

              Text('收藏').fontColor(Color.White).fontSize(12)
            }
          }
          .backgroundColor('#ff363737')
          .width(90)
          .height(40)
          .borderRadius(20)

        }
        .width('100%')
        .justifyContent(FlexAlign.SpaceBetween)
      }
      .padding({ top: 30, right: 20, bottom: 30, left: 20 })
      .width('100%')
      // .backgroundColor(Color.Pink)
      .layoutWeight(1)
      .radialGradient({
        center: ['90%', '-10%'], // 设置中心点
        radius: '150%', // 设置半径
        colors: [ // 设置颜色的
          ['#5c4111', 0.2],
          [Color.Transparent, 1] //Color.Transparent表示透明色
        ]
      })

      // 播放列表
      Column() {
        // 全部播放容器
        Row({ space: 5 }) {
          Image($r('app.media.ic_play'))
            .width(15)
            .fillColor('#d2577c')
          Text('播放全部(16)')
            .fontColor(Color.White)
            .fontSize(12)
        }
        .width('100%')
        .padding(10)

        //   歌曲列表
        List() {
          ForEach(this.songs, (item: songItemType, index: number) => {
            if (index < 3) {
              // 每一首歌曲的信息布局(带图片)
              ListItem() {
                Row() {
                  // 如果是第0个,则显示黄色文字编号
                  if (index == 0) {
                    Text((index + 1).toString())
                      .fontColor(Color.Yellow)
                      .width(30)
                      .textAlign(TextAlign.Center)
                  }
                  // 如果是第1个,则显示红色文字编号
                  if (index == 1) {
                    Text((index + 1).toString())
                      .fontColor('#d2577c')
                      .width(30)
                      .textAlign(TextAlign.Center)
                  }
                  // 如果是第2个,则显示蓝色文字编号
                  if (index == 2) {
                    Text((index + 1).toString())
                      .fontColor('#0094ff')
                      .width(30)
                      .textAlign(TextAlign.Center)
                  }

                  Row({ space: 10 }) {
                    Image(item.img)
                      .width(30)
                      .borderRadius(5)
                    Column() {
                      Text(item.name)
                        .fontColor('#ff9fa0a1')
                        .fontSize(12)
                        .width('100%')

                      Text(item.author)
                        .fontColor('#ff9fa0a1')
                        .fontSize(10)
                        .width('100%')
                    }
                  }
                  .layoutWeight(1)

                  Image($r('app.media.ic_more'))
                    .fillColor(Color.White)
                    .width(15)
                }
                .width('100%')
                .padding({ top: 8, bottom: 8 })
              }
            } else {
              // 每一首歌曲的信息布局(不带图片)
              ListItem() {
                Row() {
                  Text((index + 1).toString())
                    .fontColor(Color.White)
                    .width(30)
                    .textAlign(TextAlign.Center)
                  Row({ space: 10 }) {
                    Column() {
                      Text(item.name)
                        .fontColor('#ff9fa0a1')
                        .fontSize(12)
                        .width('100%')

                      Text(item.author)
                        .fontColor('#ff9fa0a1')
                        .fontSize(10)
                        .width('100%')
                    }
                  }
                  .layoutWeight(1)

                  Image($r('app.media.ic_more'))
                    .fillColor(Color.White)
                    .width(15)
                }
                .width('100%')
                .padding({ top: 8, bottom: 8 })
              }
            }
          })

          // 增加ListItem来防止最后一个歌曲看不到的问题
          ListItem(){
            Text('已经到低了~~~~')
              .fontColor(Color.White)
              .width('100%')
              .textAlign(TextAlign.Center)
          }
          .height(60)
          .padding({bottom:40})
        }

      }
      .width('100%')
      .backgroundColor('#ff333333')
      .layoutWeight(2)
      .borderRadius({ topLeft: 10, topRight: 10 })
    }
    .height('100%')
    .width('100%')
    .backgroundColor(Color.Black)
  }
}

初始化一个歌曲数组songs,里面包含歌曲的名字歌手,图片url等信息。

关键是使用ForEach遍历数组中的信息,根据开始设置的格式,用变量替换掉常量,就可以实现前三个歌曲格式一样,前三之外的歌曲格式一样。

 ForEach(this.songs, (item: songItemType, index: number) => { if (index < 3),index从0开始,这里表示遍历数组中前三个歌曲,之后的 else{} 表示遍历除前三之外的歌曲,数组中有几个前三之外的歌曲,就遍历几个,从第四首遍历到最后一首。

6.模拟器运行并配置权限

预览器不能直接播放歌曲,需要在模拟器中播放,而模拟器播放需要配置联网权限,使模拟器连接到网络才能正常播歌。

找到src/main/module.json5文件。

在"deliveryWithInstall": true,
    "installationFree": false,
    "pages": "$profile:main_pages",

后面加上

"requestPermissions": [
      {
        "name": "ohos.permission.INTERNET"
      }
    ],

整体是

"deliveryWithInstall": true,
    "installationFree": false,
    "pages": "$profile:main_pages",
    "requestPermissions": [
      {
        "name": "ohos.permission.INTERNET"
      }
    ],
    "abilities": [
      {
        "name": "EntryAbility",
        "srcEntry": "./ets/entryability/EntryAbility.ts",
        "description": "$string:EntryAbility_desc",
        "icon": "$media:icon",
        "label": "$string:EntryAbility_label",
        "startWindowIcon": "$media:icon",
        "startWindowBackground": "$color:start_window_background",
        "exported": true,

这样才能连上网络,才能在模拟器中正常播放歌曲。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1957604.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

环形链表 II - 力扣(LeetCode)C语言

142. 环形链表 II - 力扣&#xff08;LeetCode&#xff09; (点击前方链接即可查看题目) 给定一个链表的头节点 head &#xff0c;返回链表开始入环的第一个节点。 如果链表无环&#xff0c;则返回 null。 如果链表中有某个节点&#xff0c;可以通过连续跟踪 next 指针再次到达…

制造企业选型MES管理系统时需要关注的地方

在当今制造业全面拥抱数字化转型的浪潮中&#xff0c;MES管理系统解决方案的角色日益凸显&#xff0c;成为提升生产效率、优化资源配置的关键工具。对于制造企业而言&#xff0c;选择一款合适的MES管理系统不仅关乎当前的生产管理需求&#xff0c;更直接影响到企业未来的竞争力…

【React】详解classnames工具:优化类名控制的全面指南

文章目录 一、classnames的基本用法1. 什么是classnames&#xff1f;2. 安装classnames3. 导入classnames4. classnames的基本示例 二、classnames的高级用法1. 动态类名2. 传递数组3. 结合字符串和对象4. 结合数组和对象 三、实际应用案例1. 根据状态切换类名2. 条件渲染和类名…

【权威发布】第二届机械电子工程与软件工程国际会议(MEESE 2024)

第二届机械电子工程与软件工程国际会议 2024 International Conference on Mechanical and Electronic Engineering and Software Engineering 【1】会议简介 第二届机械电子工程与软件工程国际会议是一个专注于机械电子工程与软件工程领域交叉融合的国际盛会。会议旨在汇聚全球…

Vue3可媲美Element Plus Tree组件研发之重命名节点

在上一节《移除节点》基础上继续迭代JuanTree的功能&#xff0c;我们将实现节点重命名的功能。 实现效果&#xff1a; 可以对现有节点进行编辑&#xff0c;点回车或失去焦点完成编辑&#xff0c;如果输入为空&#xff0c;会恢复为原来的值。同时支持对新增的节点自动启用编辑功…

花几千上万学习Java,真没必要!(三十四)

1、泛型类&#xff1a; 测试代码&#xff1a; 创建一个Box类; package settest.com; public class Box<T> { // T stands for "Type" - T是一个占位符&#xff0c;用于表示具体的类型 // 类的内部可以使用T作为类型声明变量 private T t; // 构造方法&am…

ROS中使用rqt_plot快速实现数据可视化

对数据进行可视化有很多好处&#xff0c;比如可以帮助我们快速判断机器人运动轨迹是否平滑。 一般来说&#xff0c;我们会将数据保存为文件&#xff0c;然后进行绘图&#xff0c;但是在ROS中&#xff0c;有一个很好用的工具&#xff0c;叫rqt_plot&#xff0c;用它可以快速实现…

力扣高频SQL 50题(基础版)第二十四题

文章目录 力扣高频SQL 50题&#xff08;基础版&#xff09;第二十四题1729.求关注者的数量题目说明实现过程准备数据实现方式结果截图 力扣高频SQL 50题&#xff08;基础版&#xff09;第二十四题 1729.求关注者的数量 题目说明 表&#xff1a; Followers ----------------…

Maven已经导入Junit包,但是还是无法使用注解

Maven已经导入Junit包&#xff0c;但是还是无法使用注解 背景&#xff1a; 导入了Junit的依赖 <dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.12</version><scope>test</scope></d…

【北京迅为】《i.MX8MM嵌入式Linux开发指南》-第三篇 嵌入式Linux驱动开发篇-第六十五章 Linux I2C驱动实验

i.MX8MM处理器采用了先进的14LPCFinFET工艺&#xff0c;提供更快的速度和更高的电源效率;四核Cortex-A53&#xff0c;单核Cortex-M4&#xff0c;多达五个内核 &#xff0c;主频高达1.8GHz&#xff0c;2G DDR4内存、8G EMMC存储。千兆工业级以太网、MIPI-DSI、USB HOST、WIFI/BT…

Qt编写自定义控件:跑马灯文本控件

#ifndef RUNNINGTEXTWIDGET_H #define RUNNINGTEXTWIDGET_H#include <QWidget>enum Direction {North 0, //上South, //下West, //左East //右 };class RunningTextWidget : public QWidget {Q_OBJECT public:explicit RunningTextWidget(QWidget *parent nullptr);…

第二期:集成电路(IC)——智能世界的微观建筑大师

嘿&#xff0c;小伙伴们&#xff01;&#x1f44b; 我是你们的老朋友小竹笋&#xff0c;一名热爱创作和技术的工程师。上一期我们聊了聊AI芯片&#xff0c;这次我们要深入到更微观的层面&#xff0c;来探究集成电路&#xff08;IC&#xff09;的世界。准备好一起探索了吗&#…

50+受高度近视屈光参差与白内障阻碍,巫雷院长一场手术“均衡”双眼

周女士双眼近视度数一直差异很大&#xff0c;这么多年从未看清。“这次”是因为发现视力逐渐下降检查得知并发性白内障&#xff0c;以屈光性白内障手术得以一次性治疗多个问题。 周女士小时候就近视了&#xff0c;那时家里不重视&#xff0c;且自己觉得戴眼镜“不好”&#xf…

强制重新启动 iPhone

官网&#xff1a;https://support.apple.com/zh-cn/guide/iphone/iph8903c3ee6/ios 按住调高音量按钮&#xff0c;然后快速松开。按住调低音量按钮&#xff0c;然后快速松开。按住侧边按钮。当 Apple 标志出现时&#xff0c;松开侧边按钮。

【初阶数据结构题目】1.返回倒数第k个节点

文章目录 题目描述代码 题目描述 返回倒数第k个节点 代码 /*** Definition for singly-linked list.* struct ListNode {* int val;* struct ListNode *next;* };*/typedef struct ListNode ListNode; int kthToLast(struct ListNode* head, int k){ListNode* t hea…

保姆级教程!!教你通过【Pycharm远程】连接服务器运行项目代码

小罗碎碎念 这篇文章主要解决一个问题——我有服务器&#xff0c;但是不知道怎么拿来写代码&#xff0c;跑深度学习项目。确实&#xff0c;玩深度学习的成本比较高&#xff0c;无论是前期的学习成本&#xff0c;还是你需要具备的硬件成本&#xff0c;都是拦路虎。小罗没有办法…

「12月·长沙」人工智能与网络安全国际学术会议(ISAICS 2024)

人工智能与网络安全国际学术会议(ISAICS 2024)将于2024年12月20日-2024年12月22日在湖南长沙召开。会议中发表的文章将会被收录,并于见刊后提交EI核心索引。会议旨在在为国内与国际学者搭建交流平台,推进不同学科领域的融合发展&#xff0c;就当今人工智能与网络安全范畴内各学…

史上最全的Seata教学并且连接springcloudAlibaba进行使用

来都来了点个赞收藏一下在走呗~~&#x1f339;&#x1f339;玫瑰 一、Seata是什么 Seata&#xff08;Simple Extensible Autonomous Transaction Architecture&#xff0c;简单可扩展自治事务框架&#xff09;是一种分布式事务解决方案&#xff0c;旨在解决分布式系统中的事务…