我需要定制UITextField's inputView的尺寸。分配给inputView的自定义视图已经是260x220的大小,但inputView仍然显示为260x768(Portrait)和260x1024(Landscap)。我试着改变inputView's Frame,但仍然没有改变。我是否可以修改UITextField's inputView Frame,使其只占用底部屏幕的某些空间?
textField.inputView = numPadViewController.view;
[textField.inputView setFrame:CGRectMake(0, 0, 260, 220)];编辑
从this,我也尝试跟随,但没有工作!
numPadViewController.view.autoresizingMask = UIViewAutoresizingNone;
textField.inputView = numPadViewController.view;发布于 2012-11-15 18:10:12
你用的是笔尖吗?确保笔尖中的框架设置正确。另外,您不能设置inputView的框架。在将view设置为inputView之前,只能将其设置为inputView的框架。否则我需要看到更多的代码。
另外,最好使inputView具有相同的屏幕宽度(768肖像画,1024景观)。你仍然可以集中你的视野,只有透明的空间在两边。希望这能帮上忙!
https://stackoverflow.com/questions/13394564
复制相似问题