Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

objective c - How to make something like iPhone Folders? -


i'm wanting know if there's way can transform view iphone folders. in other words, want view split somewhere in middle , reveal view underneath it. possible?

alt text

edit: per suggestion below, could take screenshot of application doing this:

uigraphicsbeginimagecontext(self.view.bounds.size); [self.view.layer renderincontext:uigraphicsgetcurrentcontext()]; uiimage *viewimage = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); 

not sure this, however.

edit:2 i've figured out how add shadows view, , here's i've achieved (cropped show relevant part):

alt text

edit:3

http://github.com/jwilling/jwfolders

the basic thought take picture of current state , split somewhere. animate both parts setting new frame. don't know how take screenshot programmatically can't provide sample code…

edit: hey hey it's not looking great works ^^

// wouldn't sharp on retina displays, instead use "withoptions" , set scale 0.0 // uigraphicsbeginimagecontext(self.view.bounds.size); uigraphicsbeginimagecontextwithoptions(self.view.bounds.size, no, 0.0); [self.view.layer renderincontext:uigraphicsgetcurrentcontext()]; uiimage *f = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext();  cgrect fstrect = cgrectmake(0, 0, 320, 200); cgrect sndrect = cgrectmake(0, 200, 320, 260); // 0,200,320,280   cgimageref fimageref = cgimagecreatewithimageinrect([f cgimage], fstrect); uiimage *fcroppedimage = [uiimage imagewithcgimage:fimageref]; cgimagerelease(fimageref);  cgimageref simageref = cgimagecreatewithimageinrect([f cgimage], sndrect); uiimage *scroppedimage = [uiimage imagewithcgimage:simageref]; cgimagerelease(simageref);   uiimageview *first = [[uiimageview alloc]initwithframe:fstrect]; first.image = fcroppedimage; //first.contentmode = uiviewcontentmodetop; uiimageview *second = [[uiimageview alloc]initwithframe:sndrect]; second.image = scroppedimage; //second.contentmode = uiviewcontentmodebottom;  uiview *blank = [[uiview alloc]initwithframe:cgrectmake(0, 0, 320, 460)]; blank.backgroundcolor = [uicolor darkgraycolor];  [self.view addsubview:blank]; [self.view addsubview:first]; [self.view addsubview:second];  [uiview animatewithduration:2.0 animations:^{     second.center = cgpointmake(second.center.x, second.center.y+75); }]; 

you can uncomment 2 .contentmode lines , quality improve in case subview has offset of 10px or (you can see setting background color both subviews)

//edit 2: ok found bug. had used whole 320x480 screen, had cut off status bar should 320x460 , working great ;)


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -