iOS:自定义UITextField的inputView大小

app*_*eak 5 uitextfield ipad ios inputview

我需要自定义大小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)];
Run Code Online (Sandbox Code Playgroud)

[编辑]

这个,我也试过跟随,但没有工作!

numPadViewController.view.autoresizingMask = UIViewAutoresizingNone;
textField.inputView = numPadViewController.view;
Run Code Online (Sandbox Code Playgroud)

msg*_*bel 0

你用的是笔尖吗?确保笔尖中的框架安装正确。另外,您无法设置inputView. 在将其设置为 之前,只能设置将view成为 的框架。否则我需要查看更多代码。inputView inputView

另外,最好使它们inputView具有相同的屏幕宽度(768 纵向,1024 横向)。您仍然可以将视野居中,并且侧面有透明的空间。希望有帮助!