在UIPickerView中添加字体系列和字体大小 [英] Add font family and font size in UIPickerView

查看:301
本文介绍了在UIPickerView中添加字体系列和字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iOS编程的新手,我有一个项目,我的要求是

I'm a newbie to iOS programming, I have a project and my requirements are

1:我必须添加字体系列

1: I have to add font family

2:同样,我必须添加字体大小

2: In the same way, I have to add font size

要添加这些内容,并在顶部添加完成按钮,并在它们之间进行分叉.

These are to be added with a done button on top and a bifurcation in between them.

伙计们我已经搜索了并且无法得到它,请帮助我.预先感谢.

Guys I have searched and cant get it, kindly help me out. Thanks in advance.

推荐答案

  • 您的选择器视图应包含两个部分.
  • 第一个组件中的行数应该是字体系列列表中项目的计数.
  • 第二个组件中的行数应该是您希望提供的大小选项的数量.
  • 这些数字由选择器视图控制数据源.该协议中只有两种方法.

    These numbers are controlled by the picker view datasource. There are only two methods in this protocol.

    • 每行的标题应该是列表中相关索引处的字体系列名称,或者是字体大小"选项.

    这在选择器视图中涵盖了委托方法pickerView:titleForRow:forComponent:

    This is covered by the picker view delegate method pickerView:titleForRow:forComponent:

    您的数据源和委托通常是同一对象,通常是呈现选择器的视图控制器.

    Your datasource and delegate are typically the same object, usually the view controller that is presenting the picker.

    这篇关于在UIPickerView中添加字体系列和字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆