首页 文章 精选 留言 我的

精选列表

搜索[原生UI],共10004篇文章
优秀的个人博客,低调大师

前端 UI 框架 Svelte 4 发布

距离 Svelte 3 发布已经过去了四年多的时间,经过几个月的筹备,Svelte 4 稳定版本于今天正式发布。 新版本改进了性能、优化了开发者体验,并大改了网站。Svelte 4 主要是一个维护版本,它为下一代的 Svelte 发布奠定了基础。 性能 这个版本使 hydration 代码更小更快。为了看到其影响,SvelteKit 用户可以通过检查.svelte-kit/output/client/_app/immutable/nodes文件夹来看到其编译后的输出尺寸缩小。例如,在kit.svelte.dev 上,整个网站生成的 JS 大小减少了 12.7%。 Svelte 4 将 Svelte 包的大小减少了近 75%,这意味着在npm install上的等待时间减少了。对于第一次在 learn.svelte.dev 上加载交互式学习体验的用户、Svelte REPL 的用户以及网络条件有限的用户来说,这一改进将尤为明显。剩下的大部分软件包大小是对 eslint 的支持,这就需要发布一个 CJS 构建,一旦 eslint 重写完成,Svelte的软件包大小可以再下降 50% 以上。 Svelte 中依赖的数量已经从 61 个大大减少到 16 个。这意味着用户下载速度更快,也更不容易受到供应链攻击的影响。 开发者体验 Svelte 4 使 Svelte 的创作体验更加直观和一致: |local现在是转换的默认值,以避免动画阻碍页面转换,预处理程序现在更容易编写,多项修正使 CSP 更容易设置和使用。 对于 Web 组件的用户来说,最大的变化是对你使用 Svelte 编写自定义元素的方式进行了全面修改。通过改变它们的生成方式,可以消除了一大类错误和不一致的地方。 最后,还做了几项改进 IDE 编写的体验:“cmd + 点击” svelte 模块现在可以带你到实现,而不是.d.ts文件。 从svelte/internal导入的文件现在被隐藏,不会干扰自动补全建议,自动导入现在更可靠。 更新了网站、文档和教程 官方 svelte.dev 网站已经进行了大改。它现在被分割成多个页面,并改进了导航、更新了 TypeScript 文档、黑暗模式和增强的 REPL。SvelteKit 网站也在进行更新,以与之匹配。还更新了所有的教程链接,以指向新的 learn.svelte.dev。旧的教程仍然适用于 Safari 16.3 及以前的用户。 更多详情可查看:https://github.com/sveltejs/svelte/releases/tag/svelte%404.0.0

优秀的个人博客,低调大师

View UI(原 iView) 4.1.0 发布

4.1.0 Pascal's Wager Table: 支持树形数据。 新增属性indent-size,可设置树形的缩进宽度。 新增属性load-data,树形数据异步时使用。 row-key支持 String 类型,使用树形数据时必须为 String。 column 新增属性tree,树形数据使用,开启则该列为可展开列。 data 新增属性_showChildren,树形数据使用,指定默认子数据是否展开。 data 新增属性_loading,树形数据使用,用于异步请求子数据。 新增属性context-menu,开启后,当前行点击右键会阻止默认行为。 新增事件@on-contextmenu,当前行点击右键时触发。 其它: Select 新增事件@on-select,选择项目时触发。 Carousel 新增事件@on-click,点击幻灯片时触发,返回索引值。 Tree 使用 Render 时,可以直接使用选中功能。 Affix 新增属性use-capture。 修复 Carousel 内的 CarouselItem 样式重叠的问题。 修复 Carousel 点击指示器时,不触发 on-click 事件的问题。 修复 Collapse 异步加载时,不能打开面板的问题。 修复 Split 嵌套使用时,有时样式出错的问题。 修复 FormItem 没有监听 required 属性改变的问题。 修复 AutoComplete 的 transfer 属性,在全局配置有时错误的问题。 修复 AutoComplete 的事件 on-select 有时不触发的问题。 修复 Modal confirm 关闭按钮事件问题。 修复 TimePicker 使用向上箭头选择时出错的问题。 修复 DatePicker 有时选择日期,错误的问题。 修复 DatePicker setMonth 的问题。 修复 Split 的 min 和 max 属性在改变浏览器尺寸时不正确的问题。 修复 Time 不能动态设置 time 属性的问题。#199 修复 Avatar 自定义尺寸有时样式出错的问题。 修复 Tree 数据设置 disabled 时,不能点击箭头的问题。 修复 TypeScript 的一些问题。 新增维吾尔语。

优秀的个人博客,低调大师

Swift UI学习UITableView and protocol use

Models: UserModel.swift Views: UserInfoCell.swift Controllers: RootViewController.swift, DetailViewController.swift AppDelegate.swift: import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary? ) -> Bool { self.window = UIWindow(frame: UIScreen.mainScreen().bounds) // let rootController = RootViewController(style: UITableViewStyle.Plain) let rootNav = UINavigationController(rootViewController: rootController) self.window!.rootViewController = rootNav // self.window!.backgroundColor = UIColor.whiteColor() self.window!.makeKeyAndVisible() return true } } UserModel.swift import Foundation // // @brief The model of user, using to store user datas // @author huangyibiao // class UserModel : NSObject { var userName: String ///< store user's name, optional var userID: Int ///< store user's ID var phone: String? ///< store user's telephone number var email: String? ///< store user's email // designated initializer init(userName: String, userID: Int, phone: String?, email: String?) { self.userName = userName self.userID = userID self.phone = phone self.email = email super.init() } } UserInfoCell.swift: import Foundation import UIKit // // @brief The cell of showing user infos // @author huangyibiao // class UserInfoCell : UITableViewCell { var userNameLabel : UILabel! var phoneLabel : UILabel! var emailLabel : UILabel! init(style: UITableViewCellStyle, reuseIdentifier: String!) { super.init(style: style, reuseIdentifier: reuseIdentifier) userNameLabel = UILabel(frame: CGRectMake(30, 0, 100, 44)) userNameLabel.backgroundColor = UIColor.clearColor() userNameLabel.font = UIFont.systemFontOfSize(14) self.contentView.addSubview(userNameLabel) phoneLabel = UILabel(frame: CGRectMake(120, 0, 200, 20)) phoneLabel.backgroundColor = UIColor.clearColor() phoneLabel.font = UIFont.systemFontOfSize(12) self.contentView.addSubview(phoneLabel) emailLabel = UILabel(frame: CGRectMake(120, 20, 200, 20)) emailLabel.backgroundColor = UIColor.clearColor() emailLabel.font = UIFont.systemFontOfSize(12) self.contentView.addSubview(emailLabel) } func configureCell(userModel: UserModel?) { if let model = userModel { userNameLabel.text = model.userName phoneLabel.text = model.phone emailLabel.text = model.email } } } RootViewController.swift: import Foundation import UIKit // // @brief 作为窗体的rootViewControllor // @author huangyibiao // class RootViewController : UITableViewController, DetailViewControllerDelegate { var dataSource = NSMutableArray() var currentIndexPath: NSIndexPath? override func viewDidLoad() { super.viewDidLoad() for index in 0...12 { let model = UserModel(userName: "name:\(index + 1)", userID: index, phone: "13877747982", email: "632840804@qq.com") dataSource.addObject(model) } self.title = "UITableViewDemo" } override func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int { return dataSource.count } override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { // can't use static? let cellIdentifier: String = "UserInfoCellIdentifier" // may be no value, so use optional var cell: UserInfoCell? = tableView.dequeueReusableCellWithIdentifier(cellIdentifier) as? UserInfoCell if cell == nil { // no value cell = UserInfoCell(style: UITableViewCellStyle.Default, reuseIdentifier: cellIdentifier) } let model: UserModel? = dataSource[indexPath.row] as? UserModel cell!.configureCell(model) return cell } override func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) { let detail = DetailViewController() detail.userModel = dataSource[indexPath.row] as? UserModel detail.delegate = self currentIndexPath = indexPath self.navigationController.pushViewController(detail, animated: true) } func changeItem(forUserModel userModel: UserModel?) { var index = 0 for index = 0; index < dataSource.count; index++ { let model = dataSource[index] as UserModel if model.userID == userModel?.userID { model.phone = userModel? .phone model.email = userModel?.email tableView.reloadRowsAtIndexPaths([currentIndexPath!], withRowAnimation: UITableViewRowAnimation.Fade) break } } } } DetailViewController.swift: import Foundation import UIKit // this delegate needs a @objc, because @optional is only for objective-c, not for swift @objc protocol DetailViewControllerDelegate : NSObjectProtocol { @optional func changeItem(forUserModel userModel: UserModel?) } class DetailViewController : UIViewController { var userModel: UserModel? var delegate: DetailViewControllerDelegate? override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = UIColor.whiteColor() self.title = userModel? .userName let button = UIButton(frame: CGRectMake(10, 200, 300, 40)) button.setTitle("change", forState:UIControlState.Normal) button.backgroundColor = UIColor.redColor() button.addTarget(self, action: "onChangeButtonClick:", forControlEvents: UIControlEvents.TouchUpInside) self.view.addSubview(button) } func onChangeButtonClick(sender: UIButton!) { if userModel { userModel!.userName = "ChangeName" // changeItem needs to add a ? to the end, before (), because // this function is optional // delegate? 表示可能没有代理。而changeItem? 表示方法可能没有实现,这样写就算没有实现也没有问题 delegate?.changeItem? (forUserModel: userModel) self.navigationController.popViewControllerAnimated(true) } } } 效果图: 版权声明:本文博客原创文章,博客,未经同意,不得转载。 本文转自mfrbuaa博客园博客,原文链接:http://www.cnblogs.com/mfrbuaa/p/4727952.html,如需转载请自行联系原作者

优秀的个人博客,低调大师

Android:UI控件GestureOverlayView、gesture、手势

XML代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 <android.gesture.GestureOverlayView xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http://schemas.android.com/tools" android:id= "@+id/gestureOverlayView1" android:layout_width= "match_parent" android:layout_height= "match_parent" android:layout_alignParentLeft= "true" android:layout_alignParentTop= "true" > <RelativeLayout android:layout_width= "match_parent" android:layout_height= "match_parent" tools:context= ".MainActivity" > <TextView android:id= "@+id/textView1" android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:layout_alignParentTop= "true" android:layout_centerHorizontal= "true" android:layout_marginTop= "30dp" android:text= "Large Text" android:textAppearance= "?android:attr/textAppearanceLarge" /> <CheckBox android:id= "@+id/checkBox1" android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:layout_below= "@+id/textView1" android:layout_centerHorizontal= "true" android:layout_marginTop= "24dp" android:text= "CheckBox" /> </RelativeLayout> </android.gesture.GestureOverlayView> 本文转自 glblong 51CTO博客,原文链接:http://blog.51cto.com/glblong/1228590,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

用户登录
用户注册