Reputation: 5052
In an application to manage the costs of a living community, an user can 'terminate' a month, which is then stored in a database.
In a specific Activity
of this app, there are shown the last four months including their attribute 'terminated'. I want to show this to the user by putting a semi-transparent hook on top of the TextView
containing this month. Consider this image as example:
It seems that this doesn't work properly in Android.
textView.setCompoundDrawablesWithIntrinsicBounds(...)
does put the image on top, and it's semi-transparent too, but the initial text of the TextView disappears. Additionally, since now I haven't discovered yet how to scale the image into that TextView.
This is the actual output:
Can anybody help me with that? Should I define the scaling parameters directly in the XML layout file?
Upvotes: 2
Views: 240
Reputation: 157447
You have to use a FrameLayout
that wrap your TextView
and an ImageView
. The ImageView
will contains the semitransparent drawable. In this way the will overlap
Upvotes: 1