uCrop
uCrop copied to clipboard
Toolbar text and icon color is not getting changed
My app is using different color than white for the text and icons which appears at the top of crop screen. I've tried to change the color using theme color change in style but no success. Can you please guide me how can i change the color of text color which appears on Toolbar here is the code of manifest:
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/uCropStyle"></activity>
here is the style i've applied to chage the color:
<style name="uCropStyle" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimaryDark">@color/black</item>
<item name="colorAccent">@color/black</item>
<item name="colorPrimary">@color/yellow</item>
<item name="android:textColor">@color/black</item>
</style>
@Tahir-Bitsol Try to customize your activity as in "Customize" chapter.
If someone looking at how to change the toolbar text color:
val options = UCrop.Options()
options.setToolbarWidgetColor([required color])
UCrop.of(sourceUri, destUri)
.withOptions(options)
.start(this)
My app is using different color than white for the text and icons which appears at the top of crop screen. I've tried to change the color using theme color change in style but no success. Can you please guide me how can i change the color of text color which appears on Toolbar here is the code of manifest:
<activity android:name="com.yalantis.ucrop.UCropActivity" android:screenOrientation="portrait" android:theme="@style/uCropStyle"></activity>
here is the style i've applied to chage the color:
<style name="uCropStyle" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimaryDark">@color/black</item> <item name="colorAccent">@color/black</item> <item name="colorPrimary">@color/yellow</item> <item name="android:textColor">@color/black</item> </style>
Not working for me
Currently we can't dynamic set it, but we can do set the default color and text:
set color:(create the file if not exist)
ourProj/android/app/src/main/res/values/colors.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="ucrop_color_blaze_orange">#037ffc</color> </resources>
set toolbar text:(create the file if not exist), pls use your own text
ourProj/android/app/src/main/res/values/strings.xml
<resources> <string name="ucrop_rotate">旋轉</string> <string name="ucrop_scale">縮放</string> <string name="ucrop_crop">裁剪</string> </resources>
trick: we can use * or - instead of these tree text, which is more common and no localize issue for these common text.
Code to change toolbar color and active widget color
UCrop.Options options = new UCrop.Options(); options.setCompressionQuality(IMAGE_COMPRESSION); options.setToolbarColor(ContextCompat.getColor(this, R.color.colorWhite)); options.setStatusBarColor(ContextCompat.getColor(this, R.color.colorWhite)); options.setActiveControlsWidgetColor(ContextCompat.getColor(this, R.color.colorPrimary));