矩形图像
Rectangular image
如果我的应用程序中有图像视图,代码如下
<ImageView
android:id="@+id/imageView5"
android:layout_width="300px"
android:layout_height="90px"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
我想将公司徽标放在该图像视图中(徽标为 300px x 90px)
我知道我必须将其作为可绘制对象导入(右键单击可绘制对象 -> 新图像资产),但它只为我提供方形图标选项,不适用于此徽标。
如何将矩形图像放入我的应用程序中。
您不必使用 IDE 导入它,只需将您的徽标 "your_logo.png" 粘贴到可绘制文件夹中,然后您可以通过添加 :
来访问它
android:src="@drawable/your_logo"
到您的 ImageView
如果我的应用程序中有图像视图,代码如下
<ImageView
android:id="@+id/imageView5"
android:layout_width="300px"
android:layout_height="90px"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
我想将公司徽标放在该图像视图中(徽标为 300px x 90px)
我知道我必须将其作为可绘制对象导入(右键单击可绘制对象 -> 新图像资产),但它只为我提供方形图标选项,不适用于此徽标。
如何将矩形图像放入我的应用程序中。
您不必使用 IDE 导入它,只需将您的徽标 "your_logo.png" 粘贴到可绘制文件夹中,然后您可以通过添加 :
来访问它android:src="@drawable/your_logo"
到您的 ImageView