押されたアクションバーメニュー項目を囲むこの迷惑な青い輝きを取り除く方法を知っている人はいますか?
ありがとう、ムラジョ
はい、上書きできます...
android:actionBarItemBackground
... 各アクション アイテムの背景の描画可能なリソースを定義します。例えば
<style name="CustomActivityTheme" parent="@android:style/Theme.Holo">
<item name="android:actionBarItemBackground">@drawable/ab_item_background</item>
</style>
こちらのドキュメントを確認してください。
注: API レベル 14 未満の Android バージョンをサポートする場合は、アプリにサポート パッケージとActionBarSherlock (ABS) を含める必要があります。その後、Android 標準と ABS の両方の背景を設定する必要があります。
<style name="CustomActivityTheme" parent="@android:style/Theme.Holo">
<item name="android:actionBarItemBackground">@drawable/ab_item_background</item>
<item name="actionBarItemBackground">@drawable/ab_item_background</item>
</style>
drawable の代わりに、次のように色を使用することもできます。
<item name="actionBarItemBackground">@color/myColorDefinition</item>
ps ...または最良の方法は、状態ドローアブルを使用することです:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/button_pressed"
android:state_pressed="true" />
<item android:drawable="@drawable/button_default" />
</selector>