Closed stavkidron closed 6 years ago
Could you provide more information? Screenshot? Phone? your XML?
edit: my bad, I got an error after rebuilding the project:
Error:(224) No resource identifier found for attribute 'civ_crop' in package 'com.mypackage'
dependencies in build.gradle:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.amazonaws:aws-android-sdk-ec2:2.2.+'
compile 'com.amazonaws:aws-android-sdk-core:2.2.8'
compile 'com.amazonaws:aws-android-sdk-cognito:2.2.+'
compile 'com.android.support:design:25.1.0'
compile 'com.cesards.android:cropimageview:1.0.2.1'
testCompile 'junit:junit:4.12'
}
this is my code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.cesards.cropimageview.CropImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/portrait"
custom:civ_crop="topLeft" />
</LinearLayout>
my image: image
it looks like this no matter what I write in the civ_crop:
Are you using an emulator? A phone? what brind and OS? I need to upload a new version of the library and I want to fix any pending issue :-)
I'm using the android studio emulator, with android 6.0 (API level 23).
@cesards I do have the same problem as reported by @stavkidron on a nexus 5X running Android 7.0
Error:(53) No resource identifier found for attribute 'civ_crop' in package 'com.***'
I have the same issue
I found the problem, the correct name of the attribute is 'crop'. Not 'civ_crop' as in example!
@stavkidron
I'm having a look to this again. I know what's going on. You are using:
android:layout_width="wrap_content"
android:layout_height="wrap_content"
in the image, so that means that if the image is smaller than the parent/screen, it's not going to crop. You should be using match_parent
for that to happen. I'm going to close this. Let me know if you keep having problems 👍
I tried using the library in xml according to the example and the image does not get cropped, it just shows the full image. I want the image to be cropped at the bottom. I tried any of the options, without any affect. How do I make it work in xml?