ko1o / PYSearch

🔍 An elegant search controller which replaces the UISearchController for iOS (iPhone & iPad) .
MIT License
3.83k stars 752 forks source link

搜索框错位 #103

Closed dongdong3344 closed 7 years ago

dongdong3344 commented 7 years ago

2017-08-30 14 32 12 设置了Localization native development region为china,取消按钮还是cancel,代码将其修改为

search?.navigationItem.rightBarButtonItem?.title = "取消"

然后就出现如上图所示错位情况。

另外A控制器 Present B(search):

let nav = UINavigationController.init(rootViewController: search!)
        nav.modalPresentationStyle = .overCurrentContext
        nav.view.backgroundColor = UIColor.init(r: 80, g: 55, b: 50).withAlphaComponent(0.8)
        present(nav, animated: true, completion: nil)

如果A navigationBar 是透明的,我如何设置search的navBar不透明,换言之让2个控制器的navBar颜色一致。

还有个问题,假如有【本地文件】和【网络文件】2种类型可以搜索,当前的设计模式可以直接在search 这个view上添加2个segement进行切换吗?

ko1o commented 7 years ago

@dongdong3344 使用哪个设备和系统版本?

ko1o commented 7 years ago

demo 会出现这样的问题么?

dongdong3344 commented 7 years ago

@iphone5solo 我使用的是Xcode 9 beta 2 版本,使用的模拟器iPhone 6, 10.3版本。我没有使用Demo验证,直接pod库文件至工程里的。

ko1o commented 7 years ago

@dongdong3344 可以先测试demo 有没有问题,如果没有问题的话,看看工程是不是有什么需要修改的。如果还没解决的话,欢迎联系我 QQ 499491531 备注:PYSearch #103

dongdong3344 commented 7 years ago

@iphone5solo 没将cancel修改为“取消”正常,修改了异常。包括直接修改库里的代码,将

[[UIBarButtonItem alloc] initWithTitle:[NSBundle py_localizedStringForKey:PYSearchCancelButtonText] style:UIBarButtonItemStyleDone target:self action:@selector(cancelDidClick)];

修改为:

[[UIBarButtonItem alloc] initWithTitle:@"取消" style:UIBarButtonItemStyleDone target:self action:@selector(cancelDidClick)];

然后就异常。 另外其他2个问题,也劳请一起回复下,谢谢。

dongdong3344 commented 7 years ago

更新至0.8.3可以修复错位问题。