Giter Club home page Giter Club logo

Comments (23)

renmoqiqi avatar renmoqiqi commented on July 23, 2024 5

PYSearchViewController
处Client error attempting to change layout margins of a private view’

from pysearch.

RiberWang avatar RiberWang commented on July 23, 2024 1

iOS 13可直接获取searchBar的searchTextField,遍历不到了!暂时用这个解决吧!

if (@available(iOS 13, *)) {
    _searchTextField = searchBar.searchTextField;
}
else {
    for (UIView *subView in [[searchBar.subviews lastObject] subviews]) {
        if ([[subView class] isSubclassOfClass:[UITextField class]]) {
            UITextField *textField = (UITextField *)subView;
            textField.font = [UIFont systemFontOfSize:16];
            _searchTextField = textField;
            break;
        }
    }
}

from pysearch.

xiaohange avatar xiaohange commented on July 23, 2024 1

@xiaohange 你那个卡死大概率不是那个constraint导致的。你先fullscreen present看看还会不会卡死。

找到原因了, 你那个修复是有效的, 卡死的原因是 IQKeyboardManager 的 bug, IQKeyboardManager 引起的 _textfieldText无法输入, 再次表示感谢!

from pysearch.

Resoulte avatar Resoulte commented on July 23, 2024

searchTextField为空崩溃

from pysearch.

ieliwb avatar ieliwb commented on July 23, 2024

相同的问题,求修复

from pysearch.

Resoulte avatar Resoulte commented on July 23, 2024

没人维护了吗

from pysearch.

ko1o avatar ko1o commented on July 23, 2024

@xiaohange 麻烦能录个视频或者复现路径说下嘛 我这边测试没有发现问题

from pysearch.

davieds avatar davieds commented on July 23, 2024

更改色值应该就可以看出具体的问题了。
搜索框的UI样式,跟之前的发生了变化,圆角的弧度,光标的颜色,字体的大小。

#define HexRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
这个是设置的颜色
searchViewController.searchBarBackgroundColor = HexRGB(0x000000); searchViewController.searchSuggestionView.backgroundColor = HexRGB(0x2D2D2D); searchViewController.view.backgroundColor = HexRGB(0x2D2D2D); searchViewController.searchTextField.textColor = HexRGB(0x9B9B9B);

@ko1o

Simulator Screen Shot - iPhone 11 - 2019-09-23 at 14 55 21

from pysearch.

zczzz avatar zczzz commented on July 23, 2024

遇到相同的问题,求修复

from pysearch.

ko1o avatar ko1o commented on July 23, 2024

iOS 麻烦大家有问题在这里列举反馈哈

from pysearch.

davieds avatar davieds commented on July 23, 2024

自己回复吧,在iOS13里边UISearchBar自带searchTextField,所以在PYVc的内部里边需要增加iOS13的兼容,如果不想调整的话,可以在外边进行样式的设置。

例如:


PYSearchViewController *searchViewController = [PYSearchViewController searchViewControllerWithHotSearches:strArr searchBarPlaceholder:@"搜索内容" didSearchBlock:^(PYSearchViewController *searchViewController, UISearchBar *searchBar, NSString *searchText) {
       
    }];
    // 3. Set style for popular search and search history
    searchViewController.hotSearchStyle = PYHotSearchStyleBorderTag;
    searchViewController.searchHistoryStyle = PYHotSearchStyleDefault;
    searchViewController.removeSpaceOnSearchString = NO;

if (@available(iOS 13, *)) {
        NSMutableAttributedString *arrStr = [[NSMutableAttributedString alloc]initWithString:searchViewController.searchBar.searchTextField.placeholder attributes:@{NSForegroundColorAttributeName : HexRGB(0x9B9B9B) ,NSFontAttributeName:[UIFont systemFontOfSize:13]}];
        searchViewController.searchBar.searchTextField.attributedPlaceholder = arrStr;
        searchViewController.searchBar.searchTextField.textColor = HexRGB(0x9B9B9B);
        searchViewController.searchBar.layer.cornerRadius = 15;
        searchViewController.searchBar.layer.masksToBounds = YES;
        searchViewController.searchBar.searchTextField.backgroundColor = HexRGB(0x000000);
        searchViewController.searchBar.searchTextField.textColor = HexRGB(0x9B9B9B);
        searchViewController.searchBar.searchTextField.tintColor = [UIColor whiteColor];
        searchViewController.searchBar.searchTextField.font = [UIFont systemFontOfSize:13];

    }

from pysearch.

LeftLee avatar LeftLee commented on July 23, 2024

iOS 13 设置searchTextField样式,会出现崩溃的问题,模态弹出的样子也注意一下。希望能够维护一下。

from pysearch.

 avatar commented on July 23, 2024

iOS13,设置searchTextField和cancelButton崩溃,提示是nil

from pysearch.

xiaohange avatar xiaohange commented on July 23, 2024
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:searchViewController];
[self presentViewController:nav animated:YES completion:nil];
开启了联想~

上面的操作会使界面卡死, 报错如下:

[LayoutConstraints] Unable to simultaneously satisfy constraints.
	Probably at least one of the constraints in the following list is one you don't want. 
	Try this: 
		(1) look at each constraint and try to figure out which you don't expect; 
		(2) find the code that added the unwanted constraint or constraints and fix it. 
	(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
	<NSAutoresizingMaskLayoutConstraint:0x600001ca32f0 UISearchBar:0x7f8388e4a840.(null) == 2>,
	<NSLayoutConstraint:0x600001ca4c30 UISearchBar:0x7f8388e4a840.left == UIView:0x7f8388e4a6e0.left>,
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x600001ca4c30 UISearchBar:0x7f8388e4a840.left == UIView:0x7f8388e4a6e0.left>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.

from pysearch.

xiao99xiao avatar xiao99xiao commented on July 23, 2024

Made a possible fix in my fork xiao99xiao@243a976

from pysearch.

xiaohange avatar xiaohange commented on July 23, 2024

Made a possible fix in my fork xiao99xiao@243a976

Thanks!

from pysearch.

xiaohange avatar xiaohange commented on July 23, 2024

Simulator Screen Shot - iPhone 11 Pro Max - 2019-10-17 at 18 58 41
@xiao99xiao 我试了试你那个方法, 模拟器还是会卡到这个界面, 界面会卡死不能交互

from pysearch.

xiao99xiao avatar xiao99xiao commented on July 23, 2024

@xiaohange 你那个卡死大概率不是那个constraint导致的。你先fullscreen present看看还会不会卡死。

from pysearch.

blmyself avatar blmyself commented on July 23, 2024

@xiaohange 你那个卡死大概率不是那个constraint导致的。你先fullscreen present看看还会不会卡死。

找到原因了, 你那个修复是有效的, 卡死的原因是 IQKeyboardManager 的 bug, IQKeyboardManager 引起的 _textfieldText无法输入, 再次表示感谢!

我也用到了IQKeyboardManager,请问这个Bug怎么解决的?

from pysearch.

xiao99xiao avatar xiao99xiao commented on July 23, 2024

@blmyself 自己对PYSearchViewController禁用IQKeyboardManager应该就好了。
参看IQKeyboardManager的README https://github.com/hackiftekhar/IQKeyboardManager/blob/master/README.md

If IQKeyboardManager conflicts with other third-party library, then it's developer responsibility to enable/disable IQKeyboardManager when presenting/dismissing third-party library UI. Third-party libraries are not responsible to handle IQKeyboardManager.

from pysearch.

zhaochong0804 avatar zhaochong0804 commented on July 23, 2024

ios13崩溃遍历不到的问题可以这么样遍历
if (@available(iOS 13, *)) {
for (id subView1 in [searchBar subviews]) {
for (id subView2 in [subView1 subviews]) {
for (id subView3 in [subView2 subviews]) {
if ([subView3 isKindOfClass:[UITextField class]]) {
UITextField *textField = (UITextField *)subView3;
textField.backgroundColor = [UIColor colorWithHex:@"#F6F6F6"];
textField.font = FONT(14);
textField.layer.cornerRadius = 32/2;
textField.layer.masksToBounds = YES;
_searchTextField = textField;
break;
}
}
}
}

}else{
    for (UIView *subView in [[searchBar.subviews lastObject] subviews]) {
        if ([[subView class] isSubclassOfClass:[UITextField class]]) {
            UITextField *textField = (UITextField *)subView;
            textField.backgroundColor = [UIColor colorWithHex:@"#F6F6F6"];
            textField.font = FONT(14);
            textField.layer.cornerRadius = 32/2;
            textField.layer.masksToBounds = YES;
            _searchTextField = textField;
            break;
        }
    }
}

from pysearch.

AcYangle avatar AcYangle commented on July 23, 2024

搜索结果详情界面需要隐藏导航栏,pop回到搜索界面搜索结果tableView发生偏移
image

from pysearch.

blmyself avatar blmyself commented on July 23, 2024

@blmyself 自己对PYSearchViewController禁用IQKeyboardManager应该就好了。
参看IQKeyboardManager的README https://github.com/hackiftekhar/IQKeyboardManager/blob/master/README.md

If IQKeyboardManager conflicts with other third-party library, then it's developer responsibility to enable/disable IQKeyboardManager when presenting/dismissing third-party library UI. Third-party libraries are not responsible to handle IQKeyboardManager.

禁用了也还是卡死的,还有别的解决方法么?

from pysearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.