当前位置: 首页 > news >正文

做网站公司知名高端网站建设报价

做网站公司,知名高端网站建设报价,广州企业建站素材,搭建网站服务器需要什么配置SWift TabView 与 UIKit 中的 UITabBarController 如出一辙.在 TabView 组件中配置对应的图片和标题; 其中,Tag 用来设置不同 TabView 可动态设置当前可见 Tab;另也有一些常用的属性与 UIKit 中的类似,具体可以按需参考 api 中属性进行单独修改定制; 在 iOS 15.0 之后还可设置角…SWift TabView 与 UIKit 中的 UITabBarController 如出一辙.在 TabView 组件中配置对应的图片和标题; 其中,Tag 用来设置不同 TabView 可动态设置当前可见 Tab;另也有一些常用的属性与 UIKit 中的类似,具体可以按需参考 api 中属性进行单独修改定制; 在 iOS 15.0 之后还可设置角标记 .badge 一、初始化 // MARK: ****** TabView TabView {Text().tabItem {Image(homePage_tabBar_Normal_Image)Text(首页)}.tag(0) // .badge(Text(new)) // iOS 15.0Text().tabItem {Image(BookShelf_tabBar_Normal_Image)Text(医师在线)}.tag(1)Text().tabItem {Image(Exam_tabbar_Normal_Image)Text(考试)}.tag(2)Text().tabItem {Image(Integration_tabbar_Normal_Image)Text(教学)}.tag(3)Text().tabItem {Image(my_tabBar_Normal_Image)Text(我的)}.tag(4) } 二、简易修改 TabBar 属性相关 对 TabBar 标签文字和背景简易修改可通过如下方式: 方式一,直接通过 onAppear 进行修改设定 // MARK: ****** TabView TabView {Text().tabItem {Image(homePage_tabBar_Normal_Image)Text(首页)}.tag(0) // .badge(Text(new)) // iOS 15.0Text().tabItem {Image(BookShelf_tabBar_Normal_Image)Text(医师在线)}.tag(1)Text().tabItem {Image(Exam_tabbar_Normal_Image)Text(考试)}.tag(2)Text().tabItem {Image(Integration_tabbar_Normal_Image)Text(教学)}.tag(3)Text().tabItem {Image(my_tabBar_Normal_Image)Text(我的)}.tag(4) } .onAppear { // 渲染时// MARK: UIKit 方式// 标签栏背景色UITabBar.appearance().backgroundColor UIColor.orange// 标签文字未选中颜色UITabBar.appearance().unselectedItemTintColor UIColor.white } 方式二,也可在 init 中进行重设定 struct YHContentView: View {Environment(\.presentationMode) private var mode// MARK: - ****** 初始化 ******init() {// MARK: UIKit 方式// 标签栏背景色UITabBar.appearance().backgroundColor UIColor.orange// 标签文字未选中颜色UITabBar.appearance().unselectedItemTintColor UIColor.white}// MARK: - ****** 声明 ******// 创建变量(私有变量 private 外部不可调用)// 通过 State 修饰变量,用来绑定至所对应视图上,该变量即真实数据源与视图绑定并动态更改数据State private var weightText: String State private var heightText: String State var isToggleState: Bool true// MARK: - ****** UI ******var body: some View {// MARK: ****** TabViewTabView {Text().tabItem {Image(homePage_tabBar_Normal_Image)Text(首页)}.tag(0)// .badge(Text(new)) // iOS 15.0Text().tabItem {Image(BookShelf_tabBar_Normal_Image)Text(医师在线)}.tag(1)Text().tabItem {Image(Exam_tabbar_Normal_Image)Text(考试)}.tag(2)Text().tabItem {Image(Integration_tabbar_Normal_Image)Text(教学)}.tag(3)Text().tabItem {Image(my_tabBar_Normal_Image)Text(我的)}.tag(4)}}// MARK: - ****** 方法相关 ******// MARK: 导航返回private func goback() {withAnimation {self.mode.wrappedValue.dismiss()}} } 三、自定义 TabBar 属性 在官方 api 中提供了很多属性可供自定制化修改,如下简单列举一些常用的属性参考 注:其作用域需要基于 iOS 15 以上版本 // MARK: - ****** 初始化 ****** init() {if #available(iOS 15.0, *) {// MARK: SwiftUI 方式,作用域 iOS 15 以上版本let itemApperance UITabBarItemAppearance()// 标签图标颜色(未选中 选中)itemApperance.normal.iconColor UIColor.grayitemApperance.selected.iconColor UIColor.red// 标签文字颜色(未选中 选中)itemApperance.normal.titleTextAttributes [.foregroundColor: UIColor.green]itemApperance.selected.titleTextAttributes [.foregroundColor: UIColor.white]// 标签气泡背景颜色itemApperance.normal.badgeBackgroundColor UIColor.blueitemApperance.selected.badgeBackgroundColor UIColor.yellow// 标签气泡文字颜色itemApperance.normal.badgeTextAttributes [.foregroundColor: UIColor.gray]itemApperance.selected.badgeTextAttributes [.foregroundColor: UIColor.black]// 标签气泡位置itemApperance.normal.badgePositionAdjustment UIOffset(horizontal: -10, vertical: -10)itemApperance.selected.badgePositionAdjustment UIOffset(horizontal: 10, vertical: 10)// 标签气泡标题位置itemApperance.normal.badgeTitlePositionAdjustment UIOffset(horizontal: -10, vertical: -10)itemApperance.selected.badgeTitlePositionAdjustment UIOffset(horizontal: 10, vertical: 10)let appearance UITabBarAppearance()// 将自定义 item 属性应用到 UITabBarAppearance 的 stackedLayoutAppearance 属性中appearance.stackedLayoutAppearance itemApperance// TabBar 背景图appearance.backgroundImage UIImage(named: )// TabBar 背景色appearance.backgroundColor UIColor.orange// TabBar 顶部线条颜色appearance.shadowColor UIColor.yellow// TabBar 子元素布局样式appearance.stackedItemPositioning .centered // 默认: automatic 填充满: fill 居中: centered// TabBar 子元素间距appearance.stackedItemSpacing 1000// 将自定义配置同步到应用中UITabBar.appearance().scrollEdgeAppearance appearance // 作用域 iOS 15 以上版本} else {// MARK: UIKit 方式// 标签栏背景色UITabBar.appearance().backgroundColor UIColor.orange// 标签文字未选中颜色UITabBar.appearance().unselectedItemTintColor UIColor.white} } 以上便是此次分享的全部内容希望能对大家有所帮助!
http://www.hkea.cn/news/14267006/

相关文章:

  • 北京有哪些网站建设公司中核集团为什么排央企第一名
  • 天天seo站长工具网站建设设计图图片
  • 微信小商店怎么分销辽阳seo
  • 微官网和移动网站区别吗网站建设预算表制作
  • 校园网网站建设费用网站开发排期表
  • 在哪个网站申请建设资质桂林漓江20元背面图
  • 建设项目环评在什么网站公示wordpress 进去管理
  • 哈尔滨网站建设制作价格wordpress是干啥的
  • 裁剪图网站搭建企业资料网站
  • 精品网站建设费用 要上磐石网络wordpress 自动推送
  • 安庆网站建设工作室微信头像定制软件
  • 济南网站制作策划对象存储oss做视频网站
  • 上海移动网站建设灰产项目网
  • 手机网站域名哪里注册时间学做缝纫的网站
  • 网站说服力十大营销策略
  • 国外做项目的网站推广技术
  • 网站添加支付功能十大手游平台app排行榜
  • 在iis上部署的网站本机无法浏览解决方法建设网站是什么职位
  • 网站审核要多久如何制作学校网站
  • 网站建设的大概费用wordpress自带搜索
  • 济南 网站优化做导航网站用多大的空间
  • 长沙网站开发微联讯点官网wordpress tag优化
  • 网站需要条件aspnet网站开发
  • 网站构建的一般流程是什么调查问卷wordpress
  • 广州专业的网站建设公司企业网站seo最好方法
  • 佛山外贸网站建设网站建设云服务
  • 彩票网站 在哪里做个人做医疗类网站违法
  • 电商网站对比表wordpress检测手机端
  • 《网站推广策划》免费甜点网站模板下载
  • 百度云注册域名可以做网站明码用凡科做网站需要花钱吗