ioneday / ImageSelector

Photo picker library for Android. Support single choice、multi-choice、cropping image and preview image.
408 stars 126 forks source link

预览图片时,有虚拟按键的手机无法选择图片 #4

Open diycoder opened 8 years ago

ioneday commented 8 years ago

@diycoder 能提供具体的操作步骤么?无法选择是 不能选中单选框吗?

diycoder commented 8 years ago

单选框被虚拟键遮盖,单选框选择困难

ioneday commented 8 years ago

@diycoder 在布局的根元素加上android:fitsSystemWindows="true" 试试。

yaojunyi3721 commented 8 years ago

我也遇到这个问题了 用的华为荣耀5c activity_image_preview根布局的android:fitsSystemWindows="true" 不起作用 选择checkbox还是会和虚拟按键混在一排 非常不好点击

yaojunyi3721 commented 8 years ago

我试了微信,没有这个问题 会将视图从虚拟按键顶起

yaojunyi3721 commented 8 years ago

似乎FLAG_LAYOUT_NO_LIMITS导致android:fitsSystemWindows="true" 没有起作用

yaojunyi3721 commented 8 years ago

如果真的访微信 就不能使用FLAG_LAYOUT_NO_LIMITS

yaojunyi3721 commented 8 years ago

我已经改好了 1.去掉activity_image_preview的toolbar上的view 2.ImagePreviewActivity去掉FLAG_LAYOUT_NO_LIMITS 3.去掉activity_image_preview中的android:fitsSystemWindows="true" 应该去不去都行 4.参照http://blog.csdn.net/findsafety/article/details/51287642修改ImagePreviewFragment int screenWidth = getScreenWidth(getActivity()); // 获取屏幕宽度 ViewGroup.LayoutParams lp = imageView.getLayoutParams(); lp.width = screenWidth; lp.height = ViewGroup.LayoutParams.WRAP_CONTENT; imageView.setLayoutParams(lp);

    imageView.setMaxWidth(screenWidth);
    imageView.setMaxHeight(screenWidth * 5); //这里其实可以根据需求而定,我这里测试为最大宽度的5倍

    Glide.with(container.getContext())
            .load(new File(getArguments().getString(PATH)))
            .asBitmap()
            .into(imageView);

5.fragment_image_preview 根布局改为RelativeLayout Imageview改为<ImageView android:id="@+id/preview_image" android:layout_width="fill_parent" android:layout_height="wrap_content" android:scaleType="centerCrop" android:adjustViewBounds="true"/>

shaohui10086 commented 7 years ago

@yaojunyi3721 能不能提个Merge Request,好让 @ioneday 修复一下这个问题,我也是遇到了这个问题。。