android - 操作栏下方的图像和不同的屏幕尺寸

标签 android image layout android-actionbar

知道如何在操作栏下实现这个小尖峰,并且它可以在不同屏幕尺寸的同一位置吗?

enter image description here

最佳答案

您可以为不同的分辨率使用 .png。

否则,您可以使用 xml 文件构建三角形。
像这样:

 <?xml version="1.0" encoding="utf-8"?>
    <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
        <item >
            <rotate
                android:fromDegrees="45"
                android:toDegrees="45"
                android:pivotX="135%"
                android:pivotY="15%" >
                <shape
                    android:shape="rectangle"  >
                    <stroke android:color="@android:color/transparent" android:width="XXdp"/>
                    <solid
                        android:color="@color/mycolor"  />
                </shape>
            </rotate>
        </item>
    </layer-list>

关于android - 操作栏下方的图像和不同的屏幕尺寸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33358295/

相关文章:

css - 如果视口(viewport)超过一定宽度,停止图片元素下载图像

html - 在 HTML 表单中布局的最佳方式?

android - 重用 Android 布局

android - android MediaRecorder 的 IllegalStateException

java - Azure 移动服务 getCurrentUser

Android TimeZone 土耳其 GMT

image - 删除图像文件 yii

android - 如何在我的 Activity 中使用刷新 Logo

android - 将 gif 图像存储在 android 内存中

css - 可调整大小的三列背景图像/封面布局