GithubHelp home page GithubHelp logo

Comments (12)

Blackjacx avatar Blackjacx commented on May 30, 2024 1

from shsearchbar.

Blackjacx avatar Blackjacx commented on May 30, 2024

What exactly are your problems? Can you make a list? Then I can try to reproduce and fix them. Initially it looks pretty good right?

from shsearchbar.

csr avatar csr commented on May 30, 2024

Hey Stefan, thanks for your comment. Basically the problem is that when the user starts typing text the width of the text field changes (becomes a lot thinner).

from shsearchbar.

csr avatar csr commented on May 30, 2024

You can try to add the search bar as the title view of a navigation bar to reproduce this issue.

from shsearchbar.

csr avatar csr commented on May 30, 2024

Did you ever manage to get around this issue?

from shsearchbar.

csr avatar csr commented on May 30, 2024

in your examples, you use the search bar in the view controller content view. how do you use it as a navigation item title view?

from shsearchbar.

Blackjacx avatar Blackjacx commented on May 30, 2024

Hey, sorry for the delay. At the moment I don't have much tie to work on my projects. Work consumes a lot and I was ill so I spent a lot time on my couch 🙃

Actually I didn't plan to use it there yet but now I thought it would be another very good example 😉

I think I'll find time in December to have a look on this topic.

from shsearchbar.

csr avatar csr commented on May 30, 2024

from shsearchbar.

Blackjacx avatar Blackjacx commented on May 30, 2024

Why you don't use the standard UISearchBar (maybe in combination with UISearchController) which is made exactly for your purpose?

from shsearchbar.

csr avatar csr commented on May 30, 2024

Fine, thanks so much for your help. I'll be using the default search bar.

from shsearchbar.

Blackjacx avatar Blackjacx commented on May 30, 2024

Hey @cecexx , finally I found some time to check how you could use my search bar in the UINavigationBar. I extended the example app with your use-case. See 7a49309 for details. All you need to do is implement your titleView class and add SHSearchBar maximized to it. Then implement intrinsicContentSize in that class as I did in https://github.com/Blackjacx/SHSearchBar/blob/develop/Example/iOS%20Example/SearchBarTitleView.swift.

Then all should work. If you like to implement the standard UISearchBar then you could have a look on my answer on StackOverflow on how to do it right: https://stackoverflow.com/a/47908688/971329.

The only thing I could not figure out is how I can set a custom height on my search bar in the navigation bar. The navigation bar will not adapt its height to the height I set for the search bar.

from shsearchbar.

csr avatar csr commented on May 30, 2024

Cheers, I appreciate it! Although I've switched to the standard UISearchBar, thank you so much for keeping me updated on this.

from shsearchbar.

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.