gpt4 book ai didi

ios - 如何更改 UISearchBar 中文本字段的位置

转载 作者:可可西里 更新时间:2023-11-01 01:09:20 25 4
gpt4 key购买 nike

我的 UISearchBar 文本字段太靠近 glassIcon。我需要它们至少相隔 10 点。

UISearchBar problem

P.S - 这是在 iOS 11.2 上

最佳答案

检查一下 UISearchBar Class Reference由 Apple 并查看 searchTextPositionAdjustment

要在图标和文本之间创建 10 像素的间隙,您可以执行以下操作:

 searchBar.searchTextPositionAdjustment = UIOffset(horizontal: 10, vertical: 0)

希望对您有所帮助!

关于ios - 如何更改 UISearchBar 中文本字段的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49031450/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com