Closed tuhin10 closed 8 years ago
I want to remove the white space between lower buttons and crop view, by center aligning the cropview.
You're right. It does calculate height based on the width to make it square. Maybe it wouldn't work properly in Landscape mode. You can solve your problem by changing your layout.
If you want to keep the cropper in center, use layout_gravity="center"
and since it is a square, you would want your FrameLayout height to wrap_content
.
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/bottom_frame"
android:layout_alignParentTop="true" >
<com.fenchtose.nocropper.CropperView
android:background="#ff282828"
android:id="@+id/imageview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center"
app:grid_opacity="0.8"
app:grid_thickness="1.1dp"
app:grid_color="@color/colorAccent"/>
<ImageView
android:id="@+id/snap_button"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_margin="16dp"
android:padding="8dp"
android:layout_gravity="left|bottom"
android:background="@drawable/black_transp_circ_ripple"
android:scaleType="center"
android:src="@mipmap/ic_crop_free_white_24dp"/>
<ImageView
android:id="@+id/rotate_button"
android:layout_width="40dp"
android:layout_height="40dp"
android:padding="8dp"
android:layout_margin="16dp"
android:layout_gravity="right|bottom"
android:background="@drawable/black_transp_circ_ripple"
android:scaleType="center"
android:src="@mipmap/ic_rotate_right_white_24dp"/>
</FrameLayout>
Closed in favor of https://github.com/jayrambhia/CropperNoCropper/issues/3
it seems your are calculating the CropperView based on the width of the view. Now the problem is I'm not able to make the view center in the screen.