Hi
am having two image one is placed rightside and other is placed leftside to
the layout ....when i click on image 1 ....image 3 has to display inbetween
image 1 and image 2....similarly when i click on image 2... image 4 has to
display inbetween image1 and image2....
---->>for me here when i click on image1 ...image 3 has appearing and when i
click on image 2...... image 4 along with image 3 has appearing//////here
image 3 has to disappear
---->i set images 3and 4 as invisible in xml file .......in java file
i wrote onclick listener for image1 and image 2 .....
<ImageView android:layout_height="wrap_content"
android:scaleType="center" android:id="@+id/iv8"
android:visibility="invisible" android:layout_width="20dip"
android:src="@drawable/logo8"></ImageView>
<ImageView android:layout_height="wrap_content"
android:scaleType="center" android:visibility="invisible"
android:onClick="@drawable/logo" android:id="@+id/iv5"
android:layout_width="30dip" android:src="@drawable/logo5"></ImageView>
final ImageView img1=( ImageView)findViewById(R.id.iv1);
img1.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
ImageView img3 = (ImageView)findViewById(R.id.iv3);
if (((ImageView) v).isClickable()) {
img3.setVisibility(View.VISIBLE);
} else {
img3.setVisibility(View.INVISIBLE);
}
});
final ImageView img2=( ImageView)findViewById(R.id.iv2);
img2.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
ImageView img8=(ImageView)findViewById(R.id.iv4);
if (((ImageView) v).isClickable()) {
img4.setVisibility(View.VISIBLE);
}
else {
img4.setVisibility(View.INVISIBLE);
}
}
});
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en