Android操作栏图标似乎模糊不清

时间:2015-09-29 05:46:37

标签: android-actionbar android-drawable blur android-menu android-screen-support

我的操作栏图标在模拟器和手机中看起来模糊不清。

  1. 我试图增加图标的尺寸,图标的大小正在增加,但它再次显示相同的模糊图标。
  2. 我也试过在清单中添加仍然没有效果。
  3. 我也尝试将我的min sdk更改为14但仍然没有改变图标。
  4. 请帮助我从上个月开始坚持这个..

    MainActivity

              @Override
                    public boolean onOptionsItemSelected(MenuItem item) {
    
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            openBottomSheet();
    
            return true;
    
    
        }
    
        else if(id==R.id.action_stories_settings){
    
    
            Settings();
    
    
        }
    
        return super.onOptionsItemSelected(item);
    }
    
    
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }
    

    的Manifest.xml

    <?xml version="1.0" encoding="utf-8"?>
    

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    
    <permission
        android:name="com.appsfreax.humansofindia.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />
    
    <uses-permission android:name="com.appsfreax.humansofindia.permission.C2D_MESSAGE" />
    
    <supports-screens
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:xlargeScreens="true" />
    
    <application
        android:name=".app.ParseApplication"
        android:largeHeap="true"
        android:allowBackup="true"
        android:icon="@drawable/humans_india_icon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
    
        <activity
            android:name=".activity.MainActivity"
            android:label="@string/app_name"
            android:clearTaskOnLaunch="true"
            android:theme="@style/CustomActionBarTheme"
           >
    
    
    
    
    
    
        </activity>
    
        <activity
            android:name=".activity.Submit_story"
            android:label="@string/title_activity_sumit_story" >
        </activity>
    
        <activity
            android:name=".activity.Splash"
            android:label="@string/app_name" >
    
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
    
        </activity>
    
        <activity
            android:name=".activity.All_stories"
            android:label="@string/app_name" >
        </activity>
    
        <activity
            android:name=".activity.Errorview"
            android:label="@string/app_name" >
        </activity>
    
        <service android:name="com.parse.PushService" />
    
        <receiver
            android:name="com.parse.ParsePushBroadcastReceiver"
            android:exported="false" >
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.USER_PRESENT" />
                <action android:name="com.parse.push.intent.RECEIVE" />
                <action android:name="com.parse.push.intent.DELETE" />
                <action android:name="com.parse.push.intent.OPEN" />
            </intent-filter>
        </receiver>
        <receiver
            android:name="com.parse.GcmBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
    
                <!--
                  IMPORTANT: If you change the package name of this sample app,
                  change "com.parse.tutorials.pushnotifications" in the lines
                  below to match the new package name.
                -->
                <category android:name="com.appsfreax.humansofindia" />
            </intent-filter>
        </receiver>
    
        <meta-data android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
    
    
    </application>
    

    的build.gradle

                    apply plugin: 'com.android.application'
    
           android {
              compileSdkVersion 23
                 buildToolsVersion "23.0.1"
    
    defaultConfig {
        applicationId "com.appsfreax.humansofindia"
        minSdkVersion 13
        targetSdkVersion 20
        versionCode 102
        versionName "1.0.2"
    }
    

    menu.xml文件

    <menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context=".MainActivity">
    
    
    
    <item
        android:id="@+id/action_settings"
        android:icon="@drawable/t"
        android:orderInCategory="100"
        android:title="Botttom menu"
        app:showAsAction="always"
        />
    
    
    
    <item
        android:id="@+id/action_stories_settings"
        android:title="@string/action_settings"
        android:icon="@drawable/settings_icon"
        android:orderInCategory="200"
        app:showAsAction="always" />
    

    模糊图像

    https://drive.google.com/file/d/0B_2xbmgzcrhmcHk2QnR4V3lsWWs/view?usp=sharing

1 个答案:

答案 0 :(得分:1)

您使用的图标大小似乎有问题。我相信你正在使用小图标,这个图标正在被拉伸,看起来很模糊。

尝试使用内置48x48图标的至少70px * 70px png画布(IMO)。请参考下图。

如果您想要更大/更小的图标大小,您可以相应地更改图标大小。

enter image description here

希望这有助于:)