현재 커스텀 actionbar 만들고 해당 위치에 checkbox를 이미지로 변경하여 넣으려고 하는데요.
(체크 선택, 해제 시 이미지 변경)
코드를 제대로 넣은 듯한데, 실행해보면 체크가 되지 않고 이미지가 고정되어 나오네요;
간단한 문제 같은데 계속 몇시간째 씨름 중입니다. 고수님들 도와주세요 ㅠ
아래 빨간 박스친 부분이 체크박스가 들어갈 부분입니다.

actionbar_layout.xml (layout 폴더에 들어가 있음)
<CheckBox
android:id="@+id/wishlist_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2"
android:checked="false"
android:button="@drawable/selector_checkbox" />
selector_ckeckbox.xml (drawable 폴더에 들어가 있음)
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="false" android:drawable="@drawable/wishlist_button" />
<item android:state_checked="true" android:drawable="@drawable/wishlist_button_checked" />
</selector>
DetailActivity.java
//액션바 즐겨찾기 버튼
CheckBox drawerImageViewCheck = (CheckBox)actionBarLayout.findViewById(R.id.wishlist_button);
//ImageView
drawerImageViewCheck.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//데이터베이스 및 테이블 open
MainActivity_SQLiteHandler handler = MainActivity_SQLiteHandler.open(getApplicationContext());
//update test
handler.update(wishList_Button, "yes");
handler.close();
}
});
# 추가 질문으로 체크박스에 넣는 이미지가 커서 위 스크린샷처럼 무지막지하게 크게 나오는데,
이거 조정 어떻게 하는지 좀 알려주세요. checkbox xml 부분에서 layout_width, layout_height, layout_weight 등등
다 수정해도 이미지 사이즈가 그대로 나오네요.