小编cnb*_*oot的帖子

在swift中更改titleTextAttribute

自从我更新xcode后,我似乎无法改变titleTextAttribute.现在,当我使用以下代码时,我收到此错误:

找不到接受这个提供的参数的重载init

代码appDelegate:

UINavigationBar.appearance().titleTextAttributes = [NSFontAttributeName: UIFont(name: "Ubuntu", size: 17), NSForegroundColorAttributeName:UIColor.whiteColor()]
UIBarButtonItem.appearance().setTitleTextAttributes([NSFontAttributeName: UIFont(name: "Ubuntu-Light", size: 15), NSForegroundColorAttributeName:UIColor.whiteColor()], forState: UIControlState.Normal)
Run Code Online (Sandbox Code Playgroud)

iphone ios appdelegate swift

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

我收到 HttpResponse 但 responce.getEntity().getContent() 显示 NullPointerException

protected String doInBackground(String... urls) {
    String url = urls[0];
    String result = "";

    HttpResponse response = doResponse(url);

    if (response == null) {
        return result;
    } else {

        try {
            result = inputStreamToString(response.getEntity().getContent());

        } catch (IllegalStateException e) {
            Log.e(TAG, e.getLocalizedMessage(), e);

        } catch (IOException e) {
            Log.e(TAG, e.getLocalizedMessage(), e);
        }

    }

    return result;
}
Run Code Online (Sandbox Code Playgroud)

我将把数据发布到下面的数据库中,我附上了剩余的代码,所以请检查并清除我的问题

private HttpResponse doResponse(String url) {

    HttpClient httpclient = new DefaultHttpClient(getHttpParams());

    HttpResponse response = null;

    try {
        switch (taskType) {

        case POST_TASK:
            HttpPost httppost = new HttpPost(url); …
Run Code Online (Sandbox Code Playgroud)

java android http

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

标签 统计

android ×1

appdelegate ×1

http ×1

ios ×1

iphone ×1

java ×1

swift ×1