How to replicate the blurred text in Notification Center (iOS 8)

前端 未结 5 1037
情深已故
情深已故 2020-12-04 18:27

I am playing with TodayExtension in iOS 8 and I wondered how to apply that blur effect to the Text or to buttons. I already figured out that it has something to do with UIVi

5条回答
  •  执念已碎
    2020-12-04 18:54

    I was able to achieve the "Bearbeiten" button using AYVibrantButton with the AYVibrantButtonStyleFill style:

    // Create the button
    AYVibrantButton* moreButton = [[AYVibrantButton alloc] initWithFrame:CGRectMake(0, 0, 210, 30) style:AYVibrantButtonStyleFill];
    // Set the vibrancy effect to the one provided by notification center
    moreButton.vibrancyEffect = [UIVibrancyEffect notificationCenterVibrancyEffect];
    // Setup basic button properties
    moreButton.text = @"Show More..";
    moreButton.font = [UIFont systemFontOfSize:13.0];
    // Add it to your view
    [self.view addSubview:moreButton];
    

提交回复
热议问题