iphone - UISearchBar 高度未调整大小
<p><p>我有一个 UISearchBar,我需要相当大(68 像素的高度)。我尝试从 xib 的源代码调整大小以及从 UISearchbar 更改 UITextField 的 subview ,均未解决问题(如下图所示):</p>
<p>尝试设置外观(除高度变化外一切正常):</p>
<pre><code>[, nil] setFont:];
UITextField *searchField = ;
searchField.textColor = ;
searchField.keyboardAppearance = UIKeyboardAppearanceDark;
searchField.autocorrectionType = UITextAutocorrectionTypeNo;
CGRect searchFieldRect = searchField.frame;
searchFieldRect.size.height = 100;
searchField.frame = searchFieldRect;
</code></pre>
<p> <img src="/image/L7Dqx.png" alt="Result:"/> </p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>刚刚使用带有文本字段通知的 UITextField 来判断文本何时更改并调用我的搜索方法。</p></p>
<p style="font-size: 20px;">关于iphone - UISearchBar 高度未调整大小,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/19123143/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/19123143/
</a>
</p>
页:
[1]