2014-01-24 30 views
-1

我有GRAlertView文件。我将它们导入到我的项目中。仍然我没有得到我的输出视图中的自定义视图。这是怎么回事?我得到一个正常的警报视图。有谁知道如何使用GRAlertView文件来自定义alertView?

+0

我相信这会帮助你https://github.com/goncz9/GRAlertView。 –

+0

这个链接是我想要的那个。但是它的意思是说要在我的项目中导入这些.m和.h文件。我试过这种方式,但输出没有效果。 – user3202087

+0

导入这些文件后..这是我在我的项目中使用的代码 – user3202087

回答

0

请检查链接GRAlertView

导入文件后试试。

警报,图标:

GRAlertView *alert = [[GRAlertView alloc] initWithTitle:@"Alert" 
                 message:@"Be careful!" 
                 delegate:self 
               cancelButtonTitle:nil 
               otherButtonTitles:@"OK", nil]; 
     alert.style = GRAlertStyleAlert;   // set UIAlertView style 
     alert.animation = GRAlertAnimationLines; // set animation type 
     [alert setImage:@"alert.png"];    // add icon image 
     [alert show]; 

定制警告与图标:

GRAlertView *alert = [[GRAlertView alloc] initWithTitle:@"Custom Alert" 
              message:@"Merry Christmas!" 
              delegate:self 
           cancelButtonTitle:nil 
           otherButtonTitles:@"Close", nil]; 

     [alert setTopColor:[UIColor colorWithRed:0.7 green:0 blue:0 alpha:1] 
       middleColor:[UIColor colorWithRed:0.5 green:0 blue:0 alpha:1] 
       bottomColor:[UIColor colorWithRed:0.4 green:0 blue:0 alpha:1] 
       lineColor:[UIColor colorWithRed:0.7 green:0 blue:0 alpha:1]]; 

     [alert setFontName:@"Cochin-BoldItalic" 
       fontColor:[UIColor greenColor] 
      fontShadowColor:[UIColor colorWithRed:0.8 green:0 blue:0 alpha:1]]; 

     [alert setImage:@"santa.png"]; 
     [alert show]; 


注:复制从GRAlertView的例子,因为OP不理解的意见

+0

是的......我理解了评论,我也尝试了上面的代码......仍然输出是一样的..没有变化。你可以尝试一下并检查。 – user3202087

+0

我已将第二个代码用于自定义提醒。在viewDidLoad中创建一个按钮,并在选择按钮时,我把上面的代码。不知何故,它的定制部分没有得到使用,不知道如何。 – user3202087

相关问题