简体   繁体   English

调整UITextfield宽度

[英]Adjust UITextfield width

I have a UITextField inside of a table cell and am trying to use interface builder to extend the width. 我在表格单元格内有一个UITextField,并且正在尝试使用界面生成器来扩展宽度。 However no matter how much I drag it, it remains at 97. Am I not allowed to extend it for some reason? 但是,无论我拖动多少,它都保持在97。出于某种原因,我是否不允许扩展它? Thanks 谢谢

EDIT: Attempting to edit the text or increasing the font truncates the text..the UITextField will not change dimensions to accommodate it - it remains at 97 x 30. 编辑:尝试编辑文本或增加字体会截断文本。UITextField不会更改尺寸以适应它-仍为97 x 30。

Interface builder is tricky when it comes to some thing. 当涉及到某些事情时,界面生成器是棘手的。

Your best bet is to modify the text field's frame in cellForRowAtIndexPath: in tableview's datasource method. 最好的选择是在tableview的datasource方法中的cellForRowAtIndexPath:中修改文本字段的框架。 That should fix this kind of problems. 那应该解决这类问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM