How do ImageView and TextView in one class? (Android)



  • We need a View, which will be able to supply attributes. background (phone) src (basic image) and text

    Вот пример. Рамка - основное изображение, под ней ещё должен быть фон, а сверху текст

    Here's an example: "metallic" frame is a basic image, and there's still a background in the form of a picture, and above the text.

    How do you do that? Thank you.



  • I have a similar problem to deal with.

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <ImageView
            android:id="@+id/myImage"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:scaleType="fitXY"
            android:adjustViewBounds="true"
            android:src="@drawable/myImage"
            />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/imageHint"
            android:text="@string/imageHint"
            android:layout_centerInParent="true"
            android:textSize="@dimen/increased_text_size"
            />
    </RelativeLayout>
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2