Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

button的title太长的话就成...省略号了,能不能适配一下,让字体大小自动适配下宽度 #31

Closed
luyud opened this issue Jan 4, 2017 · 4 comments

Comments

@luyud
Copy link

luyud commented Jan 4, 2017

另外,一点小建议,与其单独放出具体的属性出来允许修改,不如直接把控件放出来,很多属性都可以修改了这样的话,比如下面这些

sheet.buttonFont
sheet.buttonColor

改为

sheet.XXXButton.XXX

因为在使用一些其他开源库的时候发现越来越多更新都倾向于使用这样的方式,比如MBProgressHud

@iTofu
Copy link
Owner

iTofu commented Jan 4, 2017

请问你正在使用的是哪个版本?大概在 16 年中旬应该就已经支持无限长度的标题了,你更新一下版本吧。

谢谢建议!控件放在 .m 文件里面的原因是考虑到 API 层级的简易性,不想让开发者过多考虑内部结构,同时因为控件是相互耦合的,直接修改控件属性可能引起一些异常,导致开发者不得不去阅读较长的框架源码来自我修复这些问题,而提供属性的方式能让框架自己(对其实是我……)修正可能出现的异常,避免浪费开发者时间。目前提供的 Properties 能保证对大部分控件属性的覆盖,如果需要覆盖更多控件的属性可以直接提 Issue,当然如果作者时间紧或者回复过慢也可以直接 Fork 过去修改 :)

@luyud
Copy link
Author

luyud commented Jan 5, 2017

抱歉回复晚了
我使用cocoapods安装,最近更新过,执行, 版本为2.7.0

pod search LCActionSheet
-> LCActionSheet (2.7.0)

可能我们说的不是同一个地方,或者是需要配置某个值我没找到,但依旧是省略号

所以我试着直接修改了 LCActionSheetCell.m 里的

titleLabel.adjustsFontSizeToFitWidth = YES;

虽然丑点,但是能显示下了

所以。。对于以上建议,那么可能需要一个 LabelAdjustsFontSizeToFitWidth 的属性吧,哈哈~~

嗯,可以关闭这个Issue了,祝好

@iTofu
Copy link
Owner

iTofu commented Jan 6, 2017

额,不好意思我以为你说的是 Title 哈!这个地方 adjustsFontSizeToFitWidth 可能是最好的处理方式了,加大 Cell 的高度的处理方式相对而言反而更加不美观。我更新下,默认该属性为 YES 吧,谢谢!

@iTofu iTofu closed this as completed in fa6eadf Jan 6, 2017
@iTofu
Copy link
Owner

iTofu commented Jan 6, 2017

对了这个问题已经更新修复了,谢谢指出!V 2.7.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants