在我的iPhone应用程序修复的UIBarButtonItem我有一个UIToolbar
的中心UITextView
,在UITextView
的左侧和UITextView
右侧的按钮的UIImage
。这是我的代码:与图像底部的工具栏的iOS 7应用
UIBarButtonItem *sendButton = [[UIBarButtonItem alloc] initWithTitle:@"Send" style:UIBarButtonItemStylePlain target:self action:@selector(dismissKeyboard)];
UIImage *image = [UIImage imageNamed:@"smile.png"];
image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
UIBarButtonItem *smile = [[UIBarButtonItem alloc] initWithImage:image style:UIBarButtonItemStylePlain target:self action:@selector(dismissKeyboard)];
UIBarButtonItem *textview = [[UIBarButtonItem alloc] initWithCustomView:_newMessageTextView];
newMessageToolbar.items = [NSArray arrayWithObjects: smile, textview, sendButton, nil];
这是结果:
我的问题是,当我打算写多行文本。当按钮被固定在UIToolbar
的底部,在垂直中心UIImage
移动:
我不明白为什么会这样,我想有UIImage
固定在底太。我该如何解决这个问题?
首先你用图片代替barbutton什么是以下情况:它试图下山或仍然作为中心 – codercat