objective c - Change placeholder colour -


i used code change placeholder colour it's not working.

i used method in category.

 -(void) drawplaceholderinrect:(cgrect)rect {     [[uicolor bluecolor] setfill];     [[self placeholder] drawinrect:rect withfont:[uifont systemfontofsize:16]]; } error: category implementing method implemented : 

'drawinrect:withfont:' deprecated: first deprecated in ios 7.0 - use -drawinrect:withattributes:

try:

[[self placeholder] drawinrect:rect                 withattributes:@{                                  nsfontattributename: [uifont systemfontofsize:16],                                  nsbackgroundcolorattributename: [uicolor bluecolor],                                  nsforegroundcolorattributename: [uicolor greencolor], //font color                                  }]; 

instead of 'drawinrect:withfont:'

*attributes nsdictionary attributes want, , there can specify font want, among stuff, color, etc.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -