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 - UISlider with ProgressView combined -


is there apple-house-made way uislider progressview. used many streaming applications e.g. native quicktimeplayer or youtube. (just sure: i'm in visualization interested)

slider  loader

cheers simon

here's simple version of you're describing.

alt text

it "simple" in sense didn't bother trying add shading , other subtleties. it's easy construct , can tweak draw in more subtle way if like. example, make own image , use slider's thumb.

this uislider subclass lying on top of uiview subclass (mytherm) draws thermometer, plus 2 uilabels draw numbers.

the uislider subclass eliminates built-in track, thermometer behind shows through. uislider's thumb (knob) still draggable in normal way, , can set custom image, value changed event when user drags it, , on. here code uislider subclass eliminates own track:

- (cgrect)trackrectforbounds:(cgrect)bounds {     cgrect result = [super trackrectforbounds:bounds];     result.size.height = 0;     return result; } 

the thermometer instance of custom uiview subclass, mytherm. instantiated in nib , unchecked opaque , gave background color of clear color. has value property knows how fill thermometer. here's drawrect: code:

- (void)drawrect:(cgrect)rect {     cgcontextref c = uigraphicsgetcurrentcontext();     [[uicolor whitecolor] set];     cgfloat ins = 2.0;     cgrect r = cgrectinset(self.bounds, ins, ins);     cgfloat radius = r.size.height / 2.0;     cgmutablepathref path = cgpathcreatemutable();     cgpathmovetopoint(path, null, cgrectgetmaxx(r) - radius, ins);     cgpathaddarc(path, null, radius+ins, radius+ins, radius, -m_pi/2.0, m_pi/2.0, true);     cgpathaddarc(path, null, cgrectgetmaxx(r) - radius, radius+ins, radius, m_pi/2.0, -m_pi/2.0, true);     cgpathclosesubpath(path);     cgcontextaddpath(c, path);     cgcontextsetlinewidth(c, 2);     cgcontextstrokepath(c);     cgcontextaddpath(c, path);     cgcontextclip(c);     cgcontextfillrect(c, cgrectmake(r.origin.x, r.origin.y, r.size.width * self.value, r.size.height)); } 

to change thermometer value, change mytherm instance's value number between 0 , 1, , tell redraw setneedsdisplay.


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 -