I am trying to make game cards in my game overlapped so that I can only see the first half of the card, and the other half is covered with the next game card. The only map that needs to be fully visible will be the last / rightmost map.
I used the following code with both the framelayout function and relativelayout to no avail. can anyone suggest some suggestions?
public int shouldShow(int numberOfCards, int card, int id) { if(card == -1) hide(id); else { findViewById(id).setBackgroundDrawable(deckimages[card]);
I tried using fill and offset methods, none of which worked for me. but I also noticed that the getwidth () and getmeasuredwidth () methods return 0.
are there any suggestions for using the layout that I should use, and why are the getwidth arent functions working?
xml code below ... there would be more images than this, but this is what I tested
<RelativeLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/RelativeLayout1"> <ImageView android:id="@+id/imageView2" android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView> <ImageView android:id="@+id/imageView3" android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView> </RelativeLayout>
source share