20 ноября 2010 г.

Изменение шрифта в компоненте UISegmentedControl

Если вам не хватает стандартных стилей компоненты UISegmentedControl, то изменение шрифта надписей, это то место, которое не описано в iOS Reference Library. Код для изменения шрифта в компоненте UISegmentedControl взят с форума www.iphonedevsdk.com:

  1. void changeUISegmentFont(UIView* aView)
  2. {
  3.   NSString* typeName = [[aView class] className];
  4.   if ([typeName compare:@"UISegmentLabel" options:NSLiteralSearch] == NSOrderedSame)
  5.   {
  6.     UILabel* label = (UILabel*)aView;
  7.     [label setTextAlignment:UITextAlignmentCenter];
  8.     [label setFont:[UIFont boldSystemFontOfSize:14]];
  9.   }
  10.   NSArray* subs = [aView subviews];
  11.   NSEnumerator* iter = [subs objectEnumerator];
  12.   UIView* subView;
  13.   while (subView = [iter nextObject])
  14.   {
  15.     changeUISegmentFont(subView);
  16.   }
  17. }

параметром этой функции и есть экземпляр обьекта UISegmentedControl.

3 комментария:

  1. ’ possibility will now seem, the place want to} comply with the on-screen instructions, both clicking ‘Add’ or dragging and dropping the icon to your home home} thecasinosource.com display screen.

  2. In short, CNC machining refers to any fabrication operation carried out by a machine that is operated or controlled by a pc. CNC machinery allows for the automation of huge manufacturing processes that otherwise would have been performed manually. Our totally air-conditioned manufacturing facilities include 18 Kern CNC precision machining centres with high-speed Duvet Inserts milling spindles. Prototypes required prematurely are produced on the identical machines - so the method switch to collection manufacturing is problem-free.