相关疑难解决方法(0)

Mipmap与可绘制文件夹

我正在使用Android Studio 1.1 Preview 1.我注意到当我创建一个新项目时,我得到以下层次结构:

在此输入图像描述

不同DPI的Mipmap文件夹,没有更多不同的DPI可绘制文件夹.

我应该将所有资源放在mipmap文件夹中,还是只放置应用程序图标?

android mipmaps android-drawable

577
推荐指数
1
解决办法
26万
查看次数

android studio找不到drawable图标

我正在尝试在MAC上的android-studio中开发,我遇到了一个问题.在活动代码中,我不能引用位于mipmap文件夹中的图像.特别是我已经创建了一个通知:

...

Notification notify = new NotificationCompat.Builder(this)
    .setContentTitle(title)
    .setContentText(body)
    .setSmallIcon(R.drawable.ic_launcher)
    .setContentIntent(startPendingIntent)
    .build();

...
Run Code Online (Sandbox Code Playgroud)

我收到错误"无法解析符号ic_launcher".奇怪也是问题,我无法将图标复制粘贴到空的drawable文件夹中.我应该在哪里以及如何放置图标以便在android studio的代码中可见?

android image android-studio

6
推荐指数
1
解决办法
8031
查看次数

Drawable“无法解析此资源 URL”

好的,我浏览了 android 文档,搜索了示例,并阅读了类似这样的 stackoverflow 问题:无法解析符号 @drawable/ic_launcher,但我仍然无法弄清楚发生了什么。

我的 Xamarin Android 应用程序中有一个 ImageButton,我已在 XML 文件中定义了它。这里:

    <TextView
        android:layout_width="40sp"
        android:layout_height="wrap_content"
        android:text=""
        android:gravity="center" />
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical">
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/increase_quantity_button"
            android:src="@drawable/arrow_drop_up"
            android:contentDescription="@string/increaseQuantity"/>
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/decrease_quantity_button"
            android:src="@drawable/arrow_drop_down"
            android:contentDescription="@string/decreaseQuantity"/>
    </LinearLayout>
    <ImageButton
        android:layout_width="40sp"
        android:layout_height="wrap_content"
        android:id="@+id/delete_item_button"
        android:src="@drawable/delete"
        android:contentDescription="@string/delete"/>

</LinearLayout>
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/item_description"/>
Run Code Online (Sandbox Code Playgroud)

然后我将这些文件放入我的可绘制文件夹中,如下所示。

在此输入图像描述

然后,当我构建应用程序时,我得到:This resource URL cannot be resolved

我不知道下一步该尝试什么。

c# android xamarin.android xamarin

2
推荐指数
1
解决办法
1214
查看次数