旋转按钮,可在iPad上观看

时间:2011-05-27 21:54:01

标签: objective-c cocoa-touch

我有一个通用应用程序,它具有以编程方式创建的按钮,可以根据设备插入特定的框架位置。现在我需要在iPad上使用支持的视图旋转相同的按钮,并且完全不知道如何操作。以下是我到目前为止的情况:

另外,我应该提一下下面的代码是在以下范围内 -(void)configureEnvironmentUsingAppData:(NSString *)appData并且所有视图都是在整个程序中以编程方式创建的。

// INBOX的开始插入按钮//////////////////////////////////////// ///////////////////

    appButton = [[UIButton buttonWithType:UIButtonTypeCustom] retain];


    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)

    {

    appButton.frame = CGRectMake(700, 25, 24, 16);   

   }

    else

    {

    appButton.frame = CGRectMake(290, 25, 24, 16);

    }


    [appButton setBackgroundImage:[UIImage imageNamed:@"envelope_white.png"]    forState:UIControlStateNormal];
     appButton.layer.borderColor=[UIColor clearColor].CGColor;
     appButton.backgroundColor = [UIColor clearColor];


    [appInboxButton addTarget:self
                      action:@selector(showAppInbox)
            forControlEvents:UIControlEventTouchDown];    


   [self.window addSubview:appButton];

0 个答案:

没有答案