Reputation: 904
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="250dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginTop="10dp"
>
<ImageView
android:id="@+id/image"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</RelativeLayout>
Image Alert:
public void imagealert(int position) {
final Dialog dialog = new Dialog(mcontext);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.getWindow()
.setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE
| WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
dialog.setContentView(R.layout.imagepopulayout);
ImageView image = (ImageView) dialog.findViewById(R.id.image);
String imgae = dbManager.GetimageUrl(datamodel.get(position).getProdcutid());
String imageUrl = "http://bhaskarmart.com/Images/" + imgae;
Picasso.with(mcontext).load(imageUrl).into(image);
dialog.show();
}
Using this code i am display image in Imageview on Dialog i want display full image full in Image view but i am unable to do please suggest me how i ll ac-chive this below is my screen :
Upvotes: 0
Views: 437
Reputation: 75788
You can use fitXY
Scales the x and y dimensions to exactly match the view size; does not maintain the image aspect ratio.
android:scaleType="fitXY"
Check Demo ImageView scaleType Samples
Upvotes: 0
Reputation: 627
For occupying image with Entire Image view you need to add one more property for Image view is:
android:scaleType="fitXY"
your ImageView in xml
<ImageView
android:id="@+id/image"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="fitXY" />
Upvotes: 3
Reputation: 663
Use this property in your ImageView.
android:scaleType="fitXY"
Upvotes: 0