【问题标题】:image view not show when use on nine patch image in android在android中的九个补丁图像上使用时图像视图不显示
【发布时间】:2021-04-27 16:51:30
【问题描述】:

我使用九个补丁图像 (shadow_15347) 作为阴影的背景,在它上面我使用带有背景的图像视图或我的徽标 png 的 src。我的九个补丁图像显示但我的徽标 png 在模拟器上运行时不显示。在活动的设计视图中,它可以正确显示,请提前告诉我哪里错了。

    <LinearLayout
        android:layout_width="0dp"
        android:layout_weight="0.2"
        android:layout_height="match_parent"
        android:gravity="center"
        android:background="@drawable/shadow_15347"
        android:orientation="vertical">


        <ImageView
            android:id="@+id/imageView5"
            android:layout_width="300dp"
            android:layout_height="300dp"
            android:background="@drawable/ic_baseline_add" />

    </LinearLayout>

【问题讨论】:

    标签: android-layout android-imageview


    【解决方案1】:

    在imageview中为什么使用android:background标签来设置你的图片,你可以src标签检查一下。

    【讨论】:

    • 我试试这个,但没有任何反应
    猜你喜欢
    • 2012-05-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-03
    • 1970-01-01
    • 1970-01-01
    • 2018-01-14
    相关资源
    最近更新 更多