ios - Colour of a substring in a string of text view -
i have text view like:
uitextview statictxt = [[uitextview alloc]initwithframe:cgrectmake(10, 80, 300, 400)]; statictxt.backgroundcolor = [uicolor clearcolor]; statictxt.text = @"this textview"; statictxt.textcolor = [uicolor whitecolor]; [self.view addsubview:statictxt];
now want text "textview" should in different colour. how can this? thanks!!
you need create attributed text string, described in answer: