Closed DharmbirChoudhary closed 6 years ago
You can set color in code like this
int colorPrimary = ContextCompat.getColor(mContext, R.color.colorPrimary);
signatureView.setPenColor(colorPrimary);
// or like signatureView.setPenColor(Color.RED);
It also works in xml see penColor
<com.kyanogen.signatureview.SignatureView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:sign="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
sign:enableSignature="true"
sign:penSize="3dp"
sign:backgroundColor="#ffffff"
sign:penColor="@color/colorAccent"/>
If this does not work for you then provide complete information i.e. Android device name, model, OS and code sample.
Pen colour not working in either XML or Code
sign:penColor="@color/colorPrimary"
signatureView.setPenColor(R.color.colorPrimary);
Both not working, Always using black colour. Please have a look on this issue. I am using Android OS 4.2.1