uibutton - iOS Create Button with two separate labels -


i create button 2 independent labels. want set in 1 button, 2 separate texts in different colors. e.g.

[mybutton settitle: @"title" forstate: uicontrolstatenormal];  [mybutton settitle2: @"title2" forstate: uicontrolstatenormal];  

is possible? maybe should need create new control? can me? grateful tutorial step step.

also, can :

uibutton *testbutton = [uibutton buttonwithtype:uibuttontypecustom]; testbutton.frame = cgrectmake(0, 0, 200, 40); [self.view addsubview:testbutton];  uilabel *firstlinetestbutton = [[uilabel alloc] initwithframe:cgrectmake(0, 0, 200, 20)]; firstlinetestbutton.text = @"first line"; firstlinetestbutton.font = [uifont systemfontofsize:12]; [testbutton addsubview:firstlinetestbutton];  uilabel *secondlinetestbutton = [[uilabel alloc] initwithframe:cgrectmake(0, 20, 200, 20)]; secondlinetestbutton.text = @"second line"; secondlinetestbutton.font = [uifont boldsystemfontofsize:12]; [testbutton addsubview:secondlinetestbutton]; 

but @vikingosegundo's solution more appropriate new sdk


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -