0
私は空調画像を持っていますが、右上隅にはブランド名(別の画像)、中央には現在の温度(画像も)が表示されます。これを実装する便利な方法はありますか?Android:イメージを別のイメージビューに埋め込むには?
私は空調画像を持っていますが、右上隅にはブランド名(別の画像)、中央には現在の温度(画像も)が表示されます。これを実装する便利な方法はありますか?Android:イメージを別のイメージビューに埋め込むには?
RelativeLayout
を使用すると、相互にビューをオーバーレイすることができます。 RelativeLayouts hereについて詳しく読むことができます。それが動作
<?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/image"
android:layout_width="30dip"
android:layout_height="30dip"
android:adjustViewBounds="true"
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/image2"
android:layout_width="30dip"
android:layout_height="30dip"
android:adjustViewBounds="true"
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/imagef"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerInParent="true"
android:background="@drawable/ph_bg" />
</RelativeLayout>
ありがとう:
これは、あなたがあなたのコードのいずれかを投稿していなかったとして、あなたのためにそれを調整する必要がありますが、あなたは、RelativeLayoutを使うことができる方法の一例です。 – Zippon