2011-09-21 1 views
0

저는 작업중인 iPhone 응용 프로그램에서 Three20 라이브러리를 사용하여 TTLauncherView를 만듭니다. 사용자가 실행기보기의 항목 중 하나를 누르고 대기하면 모든 항목이 흔들기 시작하고 각 항목 이미지의 왼쪽 상단 모서리에 "x"단추가 나타납니다. 이 버튼은 실행기보기에서 항목을 제거하는 데 사용됩니다. 이 "x"버튼을 항목 이미지와 관련하여 조금 아래로 그리고 오른쪽으로 옮기고 싶습니다.Three20 TTLauncherView에서 "닫기 버튼"의 오프셋 위치

내가 TTDeafaultStyleSheet 보았다 andfound 다음과 같은 코드가 있습니다

/////////////////////////////////////////////////////////////////////////////////////////////////// 
- (TTStyle*)launcherCloseButtonImage:(UIControlState)state { 
    return 
    [TTBoxStyle styleWithMargin:UIEdgeInsetsMake(-2, 0, 0, 0) next: 
    [TTImageStyle styleWithImageURL:nil defaultImage:nil contentMode:UIViewContentModeCenter 
           size:CGSizeMake(10,10) next:nil]]; 
} 


/////////////////////////////////////////////////////////////////////////////////////////////////// 
- (TTStyle*)launcherCloseButton:(UIControlState)state { 
    return 
    [TTShapeStyle styleWithShape:[TTRoundedRectangleShape shapeWithRadius:TT_ROUNDED] next: 
    [TTInsetStyle styleWithInset:UIEdgeInsetsMake(1, 1, 1, 1) next: 
     [TTShadowStyle styleWithColor:RGBACOLOR(0,0,0,0.5) blur:2 offset:CGSizeMake(0, 3) next: 
     [TTSolidFillStyle styleWithColor:[UIColor blackColor] next: 
     [TTInsetStyle styleWithInset:UIEdgeInsetsMake(-1, -1, -1, -1) next: 
     [TTSolidBorderStyle styleWithColor:[UIColor whiteColor] width:2 next: 
      [TTPartStyle styleWithName:@"image" style:TTSTYLE(launcherCloseButtonImage:) next: 
      nil]]]]]]]; 
} 

이 코드는 "X"버튼을 터치,하지만 난 위치를 변경하는 방법을 알아낼 수 없었다. 누구든지 어떤 제안이 있습니까?

답변

0

질문에 코드를 사용하는 방식으로 닫기 단추를 이동하는 방법을 알 수 없지만 Three20 파일 TTLauncherButton.m을 편집하여 단추의 위치를 ​​조정할 위치를 찾았습니다. - (void) layoutSubviews 메서드에서 _closeButton 속성의 원점을 조정했습니다.