IPhone之UIToolBar
来源:互联网 发布:制作毕业纪念册软件 编辑:程序博客网 时间:2024/05/17 23:47
在View中添加一个UIToolBar,其中代码如下:
//定义UIToolBar
m_pToolBar= [[UIToolbaralloc]initWithFrame:CGRectMake(0.0,self.view.frame.size.height-m_pActionButton.frame.size.height- 44.0,self.view.frame.size.width,44.0)];
[m_pToolBar setBarStyle:UIBarStyleBlackOpaque];
m_pToolBar.autoresizingMask=UIViewAutoresizingFlexib
//向uitoolbar添加控件
m_pTextField=[[UITextFieldalloc]initWithFrame:CGRectMake(12.0,7.0,264.0,31.0)];
m_pTextField.delegate= self;
[m_pTextField setBorderStyle:UITextBorderStyleRounded
[m_pTextField setFont:[UIFont fontWithName:@"Helvetica" size:16.0]];
m_pButtonAdd= [UIButton buttonWithType:UIButtonTypeCustom];
[m_pButtonAdd setFrame:CGRectMake(286.0,8.0,29.0,29.0)];
[m_pButtonAdd addTarget:selfaction:@selector(addOpinion)forControlEvents:UIControlEventTouchUpIns
[m_pButtonAdd setImage:[UIImage imageNamed:@"button_plus"]forState:UIControlStateNormal];
UIBarButtonItem *mBarButtonItemTextField =[[UIBarButtonItemalloc]initWithCustomView:m_pTextField];
UIBarButtonItem *mBarButtonItemButtonAdd =[[UIBarButtonItemalloc]initWithCustomView:m_pButtonAdd];
[m_pToolBarsetItems:[NSArrayarrayWithObjects:mBarButtonItemTextField,mBarButtonItemButtonAdd,nil]];
[mBarButtonItemTextFieldrelease];
[mBarButtonItemButtonAddrelease];
- IPhone之UIToolBar
- IPhone之UIToolBar
- iPhone开发之UIToolBar的使用
- iPhone NavigationBar和UIToolbar基础
- iPhone NavigationBar和UIToolbar基础
- OC学习之UIToolbar
- IOS之【UIToolbar】
- swift 之 UIToolbar
- UIToolBar
- UIToolbar
- UIToolbar
- UIToolbar
- UIToolbar
- UIToolBar
- UIToolbar
- UIToolBar
- UIToolbar
- iOS 之UIActionSheet+UIToolBar+UIDatePickerView
- PHP 抓取网页内容天气-IP对应地理位置等
- jQuery与其它库冲突的解决方法
- 浅谈java中的四个核心概念
- 查询并自动创建Missing Index
- Linux中find常见用法示例
- IPhone之UIToolBar
- Server Application Unavailable 出现的原因及解决方案
- Java泛型简明教程
- register volatile gd_t *gd asm ("r8")
- JAVA中double类型计算精度控制
- SI-Source Insight使用技巧
- GdPicture.NET图形处理教程连载:快速提取图片中的XMP元数据
- ASP.NET的路由系统
- 圣诞节