开发者

Offset position of "close button" in Three20 TTLauncherView

I'm using the Three20 library to create a TTLauncherView in an iPhone app that I'm working on. When the user touches and holds on one of the items in the launcher view it causes all the items to start wiggling and an "x" button to appear in the top left corner of the of each item image. This button is used to remove items from the launcher view. I would like to move this "x" button a little down and to the right relative to the item image.

I have looked at TTDeafaultStyleSheet andfound the following code:

    ///////////////////////////////////////////////////////////////////////////////////////////////////
- (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 styleWithColo开发者_JAVA百科r:[UIColor whiteColor] width:2 next:
          [TTPartStyle styleWithName:@"image" style:TTSTYLE(launcherCloseButtonImage:) next:
           nil]]]]]]];
}

This code touches the "x" button, but I haven't been able to figure out how to change its position. Does anyone have any suggestions?


I was unable to figure our how to move the close button in the way that I wanted using the code in my question, but I did find where to adjust the position of the button by editing the Three20 file TTLauncherButton.m. In the -(void)layoutSubviews method I adjusted the origin of the _closeButton property.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜