You can write a function using the following method:
-(uiimage*) getoneimagebuttonwitharrow{//tmpview do the attached control UIView *tmpview = [[UIView alloc] Initwithframe:cgrectmake (0.0 F, 0.0f, 38.0f, 32.0f)];tmpview.backgroundcolor = [Uicolor Clearcolor]; Bgimg as background uiimage* bgimg = [UIImage imagenamed:@ "Background.png"]; Uiimageview *bgimageview = [[Uiimageview alloc] initwithimage:bgimg];bgimageview.frame = tmpview.frame; Join Tmpview[tmpview Addsubview:bgimageview]; [Bgimageview release]; Inside the icon uiimageview *tmpimageview = [[Uiimageview alloc] initwithimage:[uiimage imagenamed:@ "Icon.png"]; Tmpimageview.frame = CGRectMake (4.0f, 4.0f, 24.0f, 24.0f); tmpimageview.backgroundcolor = [Uicolor Clearcolor]; Tmpimageview.alpha = 1.0f; [Tmpview Addsubview:tmpimageview]; Arrow UIImage *arrowimage = [UIImage imagenamed:@ "Arrow.png"]; Uiimageview *arrowimageview = [[Uiimageview alloc] initwithimage:arrowimage];arrowimageview.frame = CGRectMake (28.0f, 4.0f, 6.0f, 24.0f); [Tmpview Addsubview:arrowimageview]; //Get the context to get this uiimage uigraphicsbeginimagecontextwithoptions (tmpView.bounds.size, NO, 0.0); [Tmpview.layer Renderincontext:uigraphicsgetcurrentcontext ()]; UIImage *tmpimage = Uigraphicsgetimagefromcurrentimagecontext (); Uigraphicsendimagecontext (); return tmpimage;}