ImageViewがあり、クリックするとその画像をより大きな画像に置き換えたいのですが、問題があるようです。画像は下向きに伸びますが、上向きに伸びるはずです。XMLを介して動的にも実行しようとしましたが、機能していません。
// addnews button on the first screen
final ImageView addnewsback = (ImageView)findViewById(R.id.newslistback);
ImageView addnews = (ImageView)findViewById(R.id.newslistbtn);
addnews.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
addnewsback.setImageResource(R.drawable.bgbig);
vf.setDisplayedChild(0);
}
});
<RelativeLayout
android:id="@+id/c1"
android:layout_marginTop="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_alignParentLeft="true">
<ImageView
android:id="@+id/newslistback"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/holderview"
android:src="@drawable/bg" />
<ImageView
android:id="@+id/newslistbtn"
android:layout_marginLeft="14dp"
android:scaleType="fitXY"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/newslisticon" />
</RelativeLayout>