lincollincol
lincollincol

Reputation: 862

Fragment color - -how to set it to transparent?

What will be better: set transparent color in the fragments and then use color from the activity_main.xml or set color in the fragments?

Upvotes: 0

Views: 80

Answers (1)

Borislav Kamenov
Borislav Kamenov

Reputation: 721

Usually is better to declare non transparent background color of fragment because in case you have multiple fragments one over another, when you click on empty space on top most fragment, the click event will be transferred to back fragment and in case you have a button on the bottom fragment, will accept the touch event. You will get very weird behavior, so yeah, put background color on each fragment. Don't be worried about performance. It will not affect it.

Upvotes: 2

Related Questions