Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有可能以编程方式使 UISearchbar 类似于下图?
我不知道继续,请帮助我!
您可以简单地使用背景图像:
[[UISearchBar appearance] setSearchFieldBackgroundImage:[UIImage imageNamed:@"bgimage.png"]forState:UIControlStateNormal];
或者您可以继承 UISearchBar 并覆盖 layoutSubviews 方法,就像在这个线程中解释的那样:
在 iPhone 应用程序开发中自定义搜索栏