看看here,我相信你能找到滿足你需求的東西。
其基本思想是,它只是一個UIView,你從屏幕的頂部(在非常基本的)的頂部動畫。您可以通過添加漸變得到了很多票友,觸摸識別器來關閉它,等,但幾乎得到基線功能,你只需做這樣的事情:
//Create a view to hold the label and add images or whatever, place it off screen at -100
UIView *alertview = [[UIView alloc] initWithFrame:CGRectMake(0, -100, CGRectGetWidth(self.view.bounds), 100)];
//Create a label to display the message and add it to the alertView
UILabel *theMessage = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(alertview.bounds), CGRectGetHeight(alertview.bounds))];
theMessage.text = @"I'm an alert";
[alertview addSubview:theMessage];
//Add the alertView to your view
[self.view addSubview:alertview];
//Create the ending frame or where you want it to end up on screen, in this case 0 y origin
CGRect newFrm = alertview.frame;
newFrm.origin.y = 0;
//Animate it in
[UIView animateWithDuration:2.0f animations:^{
alertview.frame = newFrm;
}];
您可能正在尋找此... https://www.cocoacontrols.com/controls/ajnotificationview – jsetting32