[英]Android: Adding Frames to images
我有兩個圖像。 一個是簡單的圖像,第二個是花哨的框架。 我想在圖像上設置框架。 我搜索了一些博客,但找不到答案。 誰能告訴我有關如何做到這一點的想法或任何概念?
您可以使用FrameLayout
使用 2 個圖像 1 來實現像下面這樣的 Frame -
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/image1"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="15dp"
android:layout_gravity="center"
android:background="@drawable/image2"/>
</FrameLayout>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.