Use Nsdictionaty to set the properties of the text:
Nsdictionary * attributes = @{nsfontattributename: [Uifont fontwithname:@ "Heiti SC" size:20]}; [Confirmbarbutton settitletextattributes:attributes Forstate:uicontrolstatenormal];
Full code:
Self.inputtoolbar = [[Uitoolbar alloc]initwithframe:cgrectmake (0, 0, 320, 50)]; Self.inputToolbar.translucent = NO; self.inputtoolbar.bartintcolor= [Uicolor colorwithred:26.0/255.0 green:194.0/255.0 blue:97.0/255.0 alpha:1]; Self.inputToolbar.tintColor = [Uicolor Whitecolor]; Uibarbuttonitem *confirmbarbutton = [[Uibarbuttonitem alloc] initwithtitle:@ "Confirm" style: Uibarbuttonitemstyleplain target:self Action: @selector (Donekeyboard)]; Nsdictionary * attributes = @{nsfontattributename: [Uifont fontwithname:@ "Heiti SC" size:20]}; [Confirmbarbutton settitletextattributes:attributes Forstate:uicontrolstatenormal]; Uibarbuttonitem *spacebarbutton = [[Uibarbuttonitem alloc] Initwithbarbuttonsystemitem: Uibarbuttonsystemitemflexiblespace target:self Action: @selector (Donekeyboard)]; Self.inputToolbar.items = [Nsarray Arraywithobjects:spacebarbutton, Confirmbarbutton, Spacebarbutton, nil]; Self.textView.inputAccessoryView = Self.inputtoolbar;
References Link: http://stackoverflow.com/questions/2720733/how-do-you-set-the-font-size-on-a-uibarbuttonitem
IOS changes the font and size of text inside toolbar