我有一个默认情况下是不可见的
在活动中,我使用以下代码更改其属性:
感谢您的帮助。
ImageButton
: <ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/anchor"
android:src="@drawable/anchor"
android:elevation="6dp"
android:layout_below="@+id/rl_row_progress_bar"
android:layout_centerHorizontal="true"
android:visibility="invisible"/>
在活动中,我使用以下代码更改其属性:
if(lastPotition == 1){
mImageButton.setVisibility(View.GONE);
} else{
mImageButton.setVisibility(View.VISIBLE);
}
问题在于,在Android 5.0以下版本中,图像按钮可以正常使用,但在API 21和22中却无法使用。
这是ImageButton
的声明:
private ImageButton mImageButton;
mImageButton =(ImageButton)v.findViewById(R.id.anchor); //anchor
感谢您的帮助。
imageButton
的可见性? - Mikhail