小编ADu*_*gan的帖子

Swift - 带有NavigationBar后退按钮的UIWebview后退按钮

目前我使用我的uiwebview上的按钮返回用户搜索的每个网页,并且它的工作效果很好.但是,无论如何使用导航栏后退按钮返回以前的网页,当没有更多的页面返回时,然后打开以前的视图控制器?

继续使用的代码是返回,它只是连接到UIButton.

// Back button events
func onBackButton_Clicked(sender: UIButton)
{
    if(webview.canGoBack)
    {
        webview.goBack()
    }
}
Run Code Online (Sandbox Code Playgroud)

任何帮助都会很棒.

uiwebview ios swift

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

Xamarin表单 - 获取在Listview中选择的项目的位置

我在点击时尝试获取ListView中项目的位置时遇到了一些麻烦.

继承我的代码:

public MainPage()
{
    InitializeComponent();

    Results();
}

async void Results()
{
    var service = new RestService();
    response = await service.GetEventItemsAsync();

    Debug.WriteLine("Found: " + response.Count + " events");

    listView.ItemsSource = response;

    listView.ItemTapped += async (sender, e) =>
    {
        // Get position of item tapped 
    };
}
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激.

解决了

不得不将ItemTapped更改为ItemSelected

然后在ItemSelected里面我刚才添加了这一行:

var i = (listView.ItemsSource as List<EventItems>).IndexOf(e.SelectedItem as EventItems);
Run Code Online (Sandbox Code Playgroud)

listview xamarin xamarin.forms

7
推荐指数
1
解决办法
7997
查看次数

Azure - 通知中心命名空间错误

我目前正在尝试使用 Azure 设置推送通知,但每次我尝试设置通知中心时,都会出现错误提示“命名空间已存在。请输入其他名称” 在此处输入图片说明

有谁知道这个非常奇怪的问题的解决方案?

谢谢

azure push-notification azure-notificationhub

5
推荐指数
1
解决办法
1147
查看次数

Swift - UITableView'无法使用标识符Cell将单元格出列'

我正在为Swift中的iOS项目工作.此应用程序涉及在UITableView中显示JSON数据.

我已经解析了JSON数据,但它没有显示在tableview上.当我运行我的应用程序时,它给了我这个错误:

由于未捕获的异常'NSInternalInconsistencyException'而终止应用程序,原因:'无法使用标识符Cell将单元格出列 - 必须为标识符注册一个nib或类或连接一个storyboard中的原型单元格'

我试图以编程方式执行所有操作,而不是使用故事板.我将在下面添加我的代码.

import UIKit
import Foundation

class TableViewController: UITableViewController
{
    var postsCollection = [Post]()
    var service: PostService!

    override func awakeFromNib()
    {
        super.awakeFromNib()
    }

    override func viewDidLoad()
    {
        super.viewDidLoad()

        service = PostService()
        service.getPosts
        {
            (response) in 
            self.loadPosts(response["Events"]! as! NSArray)
        }
    }  

    func loadPosts(events: NSArray)
    {
        for event in events
        {
            //var event = event["Events"]! as! NSDictionary
            print("\n-----------------------------------------------------")
            print("           RECEIVED_JSON_DATA")
            print("-----------------------------------------------------")
            print("Title              :   \(event["Title"])")
            print("Event Description  :   \(event["EventDescription"])")
            print("Event Location     :   \(event["EventLocation"])")
            print("Event StartTime    :   \(event["EventStartTime"])")
            print("Event EndTime …
Run Code Online (Sandbox Code Playgroud)

json uitableview ios swift

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

Azure通知中心错误401

我有一些问题,设置一个控制台应用程序,将推送通知发送到iOS/Android设备.

错误显示如下:

Unhandled Exception: System.AggregateException: One or more errors
occurred. ---System.UnauthorizedAccessException: The remote server
returned an error: (401)
Unauthorized..TrackingId:ea158550-8761-41f8-821d-dbcb88fcce56,TimeStamp:18/07/2016
08:58:21 ---System.Net.WebException: The remote server returned an
error: (401) Unauthorized.    at
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)   
at
Microsoft.Azure.NotificationHubs.NotificationRequestAsyncResult`1.<GetAsyncSteps>b__3(TAsyncResult
thisPtr, IAsyncResult r)    at
Microsoft.Azure.NotificationHubs.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult
result)    --- End of inner exception stack trace ---

Server stack trace:


Exception rethrown at [0]:    at
Microsoft.Azure.NotificationHubs.Common.AsyncResult.End[TAsyncResult](IAsyncResult
result)    at
Microsoft.Azure.NotificationHubs.NotificationHubManager.EndSendNotification(IAsyncResult
result)    at
System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult
iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean
requiresSynchronization)    --- End of inner exception stack trace --- …
Run Code Online (Sandbox Code Playgroud)

c# azure apple-push-notifications google-cloud-messaging azure-notificationhub

1
推荐指数
1
解决办法
1932
查看次数