首页 文章 精选 留言 我的

精选列表

搜索[UI框架],共10000篇文章
优秀的个人博客,低调大师

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,如需转载请自行联系原作者

资源下载

更多资源
腾讯云软件源

腾讯云软件源

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

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文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册
修改密码
忘记密码