PNG画像であるImageViewとその直下のTextViewを使ってフラグメントを追加しました。 フラグメントがうまく表示されていますが、画面を回転すると画像が画面のほとんどを占め、TextViewが部分的にカットされます。 は、ここでは、コードです:Android、画像とテキストビューを画面に合わせる
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/shopping_cart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/shopping_cart" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_below="@id/shopping_cart"
android:text="@string/no_data"
android:gravity="center"/>
</RelativeLayout>
私は画面に画像とテキストの両方を表示するために、画像のサイズを変更する方法を見つけようとしている
実際、それはオプションになる可能性があります。アイデアをありがとう。イメージのサイズを変更できない場合、私はあなたの解決策を使用します – user1341300