Text

Making Widget Background Transparent

Hey,
I am working on Multi-Line Text Widget and I want to know that is there any way possible to make the widget background transparent from the present white color ?

1 Comment

Sorry for the delay, basically the api includes the following method:

setBackgroundColor(int color)
setBackgroundColor(Color.TRANSPARENT);

If you set it to another color, you will see the change immediately. If you set it to transparent value, you won't see any change, because our Multi-line widget has several views: Android activity (black by default), the layout and the background. So you will have to set layout and background colors:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF0000" >

<com.myscript.atk.mltw.MultiLineTextWidget
xmlns:myscript="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
myscript:background="@android:color/transparent" />
</RelativeLayout>

We hope it answers your question.
Best regards.

Login or Signup to post a comment