안드로이드 질문 드립니다.
조회수 599회
public class CommentItemView extends LinearLayout {
TextView comment;
TextView id;
public CommentItemView(Context context) {
super(context);
}
public CommentItemView(Context context, @androidx.annotation.Nullable AttributeSet attrs) {
super(context, attrs);
}
private void init(Context context){
LayoutInflater inflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.listview_act, this, true);
comment = findViewById(R.id.comment);
id = findViewById(R.id.id);
}
public void setComment(String Comment){
comment.setText(Comment);
}
public void setId(String Id){
id.setText(Id);
}
}
커스텀 리스트뷰를 만들기 위해서 새로운 액티비티를 만들고 생성자를 만들었는데 @androidx.annotation.Nullable AttributeSet attrs 이부분에서 에러가 나네요 구글에 검색해서 compile 'com.android.support:support-annotations:23.4.0' 추가도 해봤는데 WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html Affected Modules: app 이런식으로 오류가 나네요
-
(•́ ✖ •̀)
알 수 없는 사용자
댓글 입력