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

iOS14 适配的问题 #189

Closed
baiyidjp opened this issue Sep 24, 2020 · 9 comments
Closed

iOS14 适配的问题 #189

baiyidjp opened this issue Sep 24, 2020 · 9 comments

Comments

@baiyidjp
Copy link

手机系统iOS14,PickerView 2.7.2

  1. iOS14系统表现 pickerView的宽度没有占用全屏的宽度,右边有空间。
  2. 怎么设置多语言的环境

谢谢

@agiapp
Copy link
Owner

agiapp commented Sep 24, 2020

1.pickerView的宽度默认为当前 keyWindow 的宽度,为了适配多屏默认获取的不是屏幕的宽度。可以自己使用下面属性:

/** 组件的父视图:可以传 自己获取的 keyWindow,或页面的 view */
@property (nullable, nonatomic, strong) UIView *keyView;

如:datePickerView.keyView = self.view; // 将组件 datePickerView 添加到 self.view 上,默认是添加到 keyWindow 上

2.多语言环境在 BRPickerStyle.h 中有提供如下属性

/**
 *  设置语言(不设置或为nil时,将随系统的语言自动改变)
 *  language: zh-Hans(简体中文)、zh-Hant(繁体中文)、en(英语 )
 */
@property(nullable, nonatomic, copy) NSString *language;

@baiyidjp
Copy link
Author

好的 谢谢! 马上试试

@baiyidjp
Copy link
Author

baiyidjp commented Sep 24, 2020

如图,中英文可以了。但是右边的空隙还是比左边的大,并没有居中,我也传了当前controller的view给keyView了。

image

image

@91renb

@agiapp
Copy link
Owner

agiapp commented Sep 24, 2020

BRDatePickerModeDate 是 UIDatePicker 系统自带的样式,暂无法自定义控制;
可以设置 pickerMode == BRDatePickerModeYMD,这个是 UIPickerView 封装的样式,提供了很多自定义样式属性

@baiyidjp
Copy link
Author

BRDatePickerModeDate 是 UIDatePicker 系统自带的样式,暂无法自定义控制;
可以设置 pickerMode == BRDatePickerModeYMD,这个是 UIPickerView 封装的样式,提供了很多自定义样式属性

好的 设置完可以居中了。谢谢

@agiapp
Copy link
Owner

agiapp commented Sep 24, 2020

多谢你的提醒,刚才测试了一下BRDatePickerModeDate也是可以实现居中。
在iOS14里默认设置 datePicker 的 frame 宽高会不生效。需要先设置 datePickerMode,再设置 frame 才会生效,估计是iOS14的一个小bug。后面我会优化更新一下~

@baiyidjp
Copy link
Author

多谢你的提醒,刚才测试了一下BRDatePickerModeDate也是可以实现居中。
在iOS14里默认设置 datePicker 的 frame 宽高会不生效。需要先设置 datePickerMode,再设置 frame 才会生效,估计是iOS14的一个小bug。后面我会优化更新一下~

中文下这个时间: 年的显示有点被切掉了一点 机型是iPhoneX

image

@agiapp
Copy link
Owner

agiapp commented Sep 25, 2020

已适配iOS14显示样式,同iOS14之前版本显示样式一致,不需要额外再设置API,请更新到最新版本进行使用

@baiyidjp
Copy link
Author

已经使用最新版本,谢谢

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