Best radio-button implementation for IOS(IOS 的最佳单选按钮实现)
问题描述
我想问一下是否有关于如何在 iPhone 应用上实现单选按钮选项的示例.
我发现 Picker View 对于一个简单的选择功能来说相当大.
我不确定 Apple 是否故意排除了单选按钮,以及从可用性/用户体验的角度来看,简单地使用 Picker View 是否更好.
我对最好的单选按钮实现应该是什么样子有一些想法.它可以基于 UIButton 类并使用它的选定"状态来指示组中的一个.UIButton 在 IB 中有原生的自定义选项,所以设计 XIB 很方便.还应该有一种使用 IB 插座连接对按钮进行分组的简单方法:
我已经在这个 .
I would like to ask if there are examples out there on how to implement radio-button options on an iPhone app.
I find the Picker View quite big for a simple selection feature.
I'm not sure if Apple excluded radio buttons on purpose, and whether if it is better to simply use a Picker View from a usability / user experience point-of-view.
I have some thoughts on how the best radio button implementation should look like. It can be based on UIButton class and use it's 'selected' state to indicate one from the group. The UIButton has native customisation options in IB, so it is convenient to design XIBs.
Also there should be an easy way to group buttons using IB outlet connections:
I have implemented my ideas in this RadioButton class. Works like a charm:
Download the sample project.
这篇关于IOS 的最佳单选按钮实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:IOS 的最佳单选按钮实现
基础教程推荐
- NSString intValue 不能用于检索电话号码 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- iOS4 创建后台定时器 2022-01-01
