ManWithNoName
ManWithNoName

Reputation: 167

if statement on images

I have an image that is a tick. At the moment i know how to set visibilty using GONE/VISIBLE.

    tick.setVisibility(View.VISIBLE);

I want to be able to detect whether an image is visible using an if statement.

if (tick is visible){
i++
}

Thanks

Upvotes: 0

Views: 144

Answers (2)

kannappan
kannappan

Reputation: 2250

Try this code it will help you.

if (ticket.getVisiblity() == View.VISIBLE) {
   i++;
}

Upvotes: 0

Geralt_Encore
Geralt_Encore

Reputation: 3771

if (View.VISIBLE == tick.getVisibility()) {
    i++;
}

Upvotes: 2

Related Questions