添加建议到自定义键盘

时间:2015-06-22 08:19:10

标签: ios xcode swift ios8

我使用自定义键盘 而且我想知道我是如何在键盘上添加建议的,我在这个问题上看到了几个问题,没有人会得到答案,无论你是否可以得到帮助,甚至只是这样做的方式

1 个答案:

答案 0 :(得分:0)

    public int VersionNumber = 2005001; //to be updated to 2999999 when building to distribute
    public static boolean CheckUpdate() throws Exception {
        int ver = Integer.parseInt(getText("http://www.fragbashers.net/smite/version.txt"));
        System.out.println(ver);

    if (ver > VersionNumber) {
        System.out.println("Current version lower than newest!");
        return true;
    } else {
        return false;
    }
}

public static String getText(String url) throws Exception {
    URL website = new URL(url);
    URLConnection connection = website.openConnection();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(
            connection.getInputStream()));
    StringBuilder response = new StringBuilder();
    String inputLine;

    while ((inputLine = in.readLine()) != null) 
        response.append(inputLine);

    in.close();

    return response.toString();
}

也阅读这篇文章http://atmac.org/ios-8-keyboards-for-accessibility