objective c - iOS: Creating buttons using IB vs. creating buttons programmatically -
i'm web , android developer, , i'm learning ios development, noticed if want build view (let's button) have create using interface builder
, or can make happen programmatically doing instance :
uibutton *but= [uibutton buttonwithtype:uibuttontyperoundedrect]; [but addtarget:self action:@selector(buttonclicked:) forcontrolevents:uicontroleventtouchupinside]; [but setframe:cgrectmake(52, 252, 215, 40)]; [but settitle:@"login" forstate:uicontrolstatenormal]; [but setexclusivetouch:yes]; [self.view addsubview:but];
but if did button won't visible in storyboard
.
in android there xml
files can build layouts whether drag , drop
or xml programming(which prefer) , both ways button visible if want @ layout.
but here in ios
can't find way @ storyboard
code.
i think i'm asking is: possible see storyboard
code ? , best approach designing views in ios ?
note researched lot, i'm new ios
world found lot of stuff don't recognize or understand yet.
right click on main.storyboard open source code.
Comments
Post a Comment