2016-02-28 98 views
1

我嘗試使用下面的代碼導入com.parse.ParseImageViewcom.parse.ParseQueryAdapter。但它顯示了這個錯誤:無法導入ParseImageView,ParseQueryAdapter sdk versoin 1.13.0

Error:(26, 13) Failed to resolve: com.parse:parseui-login-android:0.0.1 Error:(27, 13) Failed to resolve: com.parse:parseui-widget-android:0.0.1

package com.example.satti.party; 

import android.content.Context; 
import android.view.View; 
import android.view.ViewGroup; 
import android.widget.TextView; 
import com.parse.ParseFile; 
import com.parse.ParseImageView; 
import com.parse.ParseObject; 
import com.parse.ParseQuery; 
import com.parse.ParseQueryAdapter; 




public class customadp extends ParseQueryAdapter<ParseObject> { 

public customadp(Context context) { 
    // Use the QueryFactory to construct a PQA that will only show 
    // Todos marked as high-pri 
    super(context, new ParseQueryAdapter.QueryFactory<ParseObject>() { 
     public ParseQuery create() { 
      ParseQuery query = new ParseQuery("city"); 
      query.whereEqualTo("highPri", true); 
      return query; 
     } 
    }); 
} 

// Customize the layout by overriding getItemView 
@Override 
public View getItemView(ParseObject object, View v, ViewGroup parent) { 
    if (v == null) { 
     v = View.inflate(getContext(), R.layout.actvity_priest1, null); 
    } 

    super.getItemView(object, v, parent); 

    // Add and download the image 
    ParseImageView todoImage = (ParseImageView) v.findViewById(R.id.icon); 
    ParseFile imageFile = object.getParseFile("image"); 
    if (imageFile != null) { 
     todoImage.setParseFile(imageFile); 
     todoImage.loadInBackground(); 
    } 

    // Add the title view 
    TextView titleTextView = (TextView) v.findViewById(R.id.txt); 
    titleTextView.setText(object.getString("title")); 

    // Add a reminder of how long this item has been outstanding 
    TextView timestampView = (TextView) v.findViewById(R.id.cur); 
    timestampView.setText(object.getCreatedAt().toString()); 
    return v; 
} 

} 

回答

1

添加你gradle這個build文件的依賴關係標籤下:

compile 'com.parse:parseui-widget-android:0.0.1', 
compile 'com.parse:parseui-login-android:0.0.1' 
+0

我在我的gradle中添加了這兩行,但是它顯示錯誤錯誤:(26,13) 無法解決:com.parse:parseui-login-android:0.0.1 錯誤:(27,13) 無法解析:com.parse:parseui-widget-android :0.0.1 –

0

該序列順序在gradle這個對我來說

工作
compile 'com.parse.bolts:bolts-android:1.+' 
compile 'com.parse:parse-android:1.+' 
compile 'com.parse:parseui-widget-android:0.0.1' 
compile 'com.parse:parseui-login-android:0.0.1'