0

実際のデバイス (電話) とエミュレーターに異なるスケールの ImageView があります。エミュレーターは画像を正しく表示しますが、実際のデバイス (電話) は表示しません。デバイス(電話)の画面では画像が小さくなります。

これは私のJavaコードです:

...

rootView = (ViewGroup) inflater.inflate(R.layout.arabic_page, container, false);
waraka = (ImageView) rootView.findViewById(R.id.waraka);
...
     InputStream istr;
            try {
//Search in OBB 
    istr = getExpansionFile().getInputStream(num_image+".png");
    Bitmap bitmap = BitmapFactory.decodeStream(istr);
    Drawable draw =new BitmapDrawable(getResources(),bitmap);
    waraka.setImageDrawable(draw);

これは私のレイアウトコードです:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#FFFFFF"
        tools:context=".MainActivity">
        <ImageView
            android:id="@+id/waraka"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentTop="true" 
            android:scaleType="fitCenter"/></RelativeLayout>
4

3 に答える 3