相关疑难解决方法(0)

如何在iOS中实现弹出对话框

在计算之后,我想显示向用户传达消息的弹出框或警告框.有谁知道在哪里可以找到更多相关信息?

popup ios

295
推荐指数
6
解决办法
30万
查看次数

在iOS中显示与Android中的Toast功能相同的消息

我需要知道iOS中是否存在任何与Android中的Toast消息相似的方法.也就是说,我需要显示一条消息,该消息在几秒钟后自动被解除.这类似于Android环境中Toast类的功能.

android ios

113
推荐指数
6
解决办法
10万
查看次数

UIAlertView首先弃用了IOS 9

我尝试了几种方法来使用UIAlertController而不是UIAlertView.我尝试了几种方法,但我无法使警报行动起作用.这是我的代码在IOS 8和IOS 9中正常工作,但是出现了弃用的标志.我尝试了下面的优雅建议,但我无法在此背景下使其发挥作用.我需要提交我的应用程序,这是最后要解决的问题.感谢您的任何进一步建议.我是新手.

#pragma mark - BUTTONS ================================
- (IBAction)showModesAction:(id)sender {
NSLog(@"iapMade: %d", iapMade3);

// IAP MADE ! ===========================================
if (!iapMade3) {

    //start game here
    gamePlaysCount++;
    [[NSUserDefaults standardUserDefaults]setInteger:gamePlaysCount forKey:@"gamePlaysCount"];
    NSLog(@"playsCount: %ld", (long)gamePlaysCount);

    if (gamePlaysCount >= 4) {
    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Basic"
                                                     message: THREE_PLAYS_LIMIT_MESSAGE
                                                    delegate:self
                                           cancelButtonTitle:@"Yes, please"
                                           otherButtonTitles:@"No, thanks", nil];
       [alert show];

        NSString *path = [[NSBundle mainBundle] pathForResource:@"cow" ofType:@"wav"];
        _pop =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
        [_pop play];
        [self dismissViewControllerAnimated:true completion:nil];

    } else {
        if (gamePlaysCount == 1)  {
            // Create …
Run Code Online (Sandbox Code Playgroud)

objective-c uialertview ios uialertcontroller

104
推荐指数
5
解决办法
11万
查看次数

创建iPhone弹出菜单与Mail App Menu类似

当您想要回复邮件时,我想创建一个类似于邮件应用程序中的弹出菜单.我在多个应用程序中看到过这个,所以我不确定框架中是否有内置的东西或者那些示例代码.

UIActionSheet示例

cocoa-touch objective-c uiview ios

21
推荐指数
5
解决办法
2万
查看次数

21
推荐指数
2
解决办法
3万
查看次数

自定义警报(UIAlertView)与swift

如何使用Swift创建自定义警报?我尝试从Objective c翻译指南但加载全屏布局

为了方便我可以加载透明背景的新布局我试试这个:

    listaalertviewcontroller.view.backgroundColor = UIColor.clearColor()
    let purple = UIColor.purpleColor() // 1.0 alpha
    let semi = purple.colorWithAlphaComponent(0.5)

    listaalertviewcontroller.view.backgroundColor = semi


    presentingViewController.modalPresentationStyle = UIModalPresentationStyle.CurrentContext

    self.presentViewController(listaalertviewcontroller, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)

在动画中它是透明的,但是当动画结束时它是不透明的......我在视图中关闭了不透明的选项......我做错了什么?

uialertview ios swift

17
推荐指数
2
解决办法
3万
查看次数

IOS以编程方式创建UIAlertViewController

我正在使用带有代码的ViewController(没有故事板).我正在尝试添加和AlertController

我已经在.m中声明了

@property (nonatomic, strong) UIAlertController *alertController;
Run Code Online (Sandbox Code Playgroud)

并在loadview方法中初始化

//alertviewController
    _alertController = [[UIAlertController alloc]initWithNibName:nil bundle:nil];
Run Code Online (Sandbox Code Playgroud)

并在viewDidLoad以下位置调用alertview :

_alertController = [UIAlertController alertControllerWithTitle:@"Error display content" message:@"Error connecting to server, no local database" preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction *ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
                LandingPageViewController *viewController = [[LandingPageViewController alloc] initWithNibName:nil bundle:nil];
    //            viewController.showNavBarBackButton = YES;
                [[AppDelegate sharedAppDelegate].rootViewController cPushViewController:viewController];
}];
[_alertController addAction:ok];
[self presentViewController:_alertController animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)

我不知道为什么警报没有显示出来.我的代码出了点问题.如何以alertViewController编程方式设置和调用?

objective-c uialertview ios

16
推荐指数
2
解决办法
4万
查看次数

在swift中显示UIAlertView时出错

我试图在我的快速应用程序中显示UIAlertView

    alert = UIAlertView(title: "",
        message: "bla",
        delegate: self,
        cancelButtonTitle: "OK")
    alert!.show()
Run Code Online (Sandbox Code Playgroud)

=> BAD_ACESS错误: - [_ UIAlertViewAlertControllerShim initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:]()

所以我怀疑自己.我把它设置为零

    alert = UIAlertView(title: "",
        message: "bla",
        delegate: nil,
        cancelButtonTitle: "OK")
    alert!.show()
Run Code Online (Sandbox Code Playgroud)

=> ARM_DA_ALIGN错误: - [_ UIAlertViewAlertControllerShim initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:]()


完整的代码

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UIAlertViewDelegate {

    @lazy var window = UIWindow(frame: UIScreen.mainScreen().bounds)
    @lazy var locationManager = CLLocationManager()
    var alert: UIAlertView? = nil

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
        //setup dummy window
        self.window.backgroundColor = UIColor.whiteColor()
        self.window.rootViewController = UIViewController() …
Run Code Online (Sandbox Code Playgroud)

uialertview swift uialertcontroller

9
推荐指数
2
解决办法
1万
查看次数

在swift中创建一个简单的警报

看起来alertstatus不能在swift中使用.

你能帮助我实现下面代码的替代解决方案吗?

  [self alertStatus:@"Message!" :@"Alert title" :0];
Run Code Online (Sandbox Code Playgroud)

objective-c swift

6
推荐指数
2
解决办法
4696
查看次数

如何在Flutter中制作AlertDialog?

我正在学习在Flutter中构建应用程序。现在我来警报对话框。我之前在AndroidiOS中完成过这些操作,但是如何在Flutter中发出警报?

以下是一些相关的SO问题:

我想进行更一般的规范问答,所以我的答案如下。

dart flutter flutter-alertdialog

6
推荐指数
9
解决办法
7351
查看次数

以编程方式进行操作

任何人都可以帮助使用swift语言通过xcode6以编程方式创建动作表控制器。

uiactionsheet swift ios8

-2
推荐指数
1
解决办法
2235
查看次数