Android Borderless Button: No resource found that matches the specified name (in 'drawable' with value '@ drawable / button_pressed'

My application supports at least API 8 (platform version 2.2). But borderless buttons require API 11. So when I try to make a button like:

             <button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:onClick="displayText"
                style="?android:attr/borderlessButtonStyle" ></button>

      

Reference: Subdivision of Borderless Button in This Developer Guide

Am I getting an error ? android: attr / borderlessButtonStyle requires API level 11 (current minimum 8)

I have a support library in my project folder . So I removed the android namespace and changed it to (suggested in some comment here ) and now I am getting this error: Resource not found that matches the specified name (in 'style' with value '? Attr / borderlessButtonStyle'). android-support-v4.jar

libs

style="?attr/borderlessButtonStyle"

I couldn't find any mention of BorderlessButtonStyle, or even the name "button" in this , or this document?

What should I do? Which support library should I use?


EDIT 1 As suggested by @NaveenTamatar in the comment:

Res / pull / selector_transparent_button.xml  

Problem 1: -

The "exitFadeDuration" attribute is only used in API level 11 and above (current min is 8)

So, I tried this with small changes:

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

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true" android:color="#227EC9" ></item>
    <item android:state_selected="true" android:color="#227EC9"></item>
    <item android:state_enabled="false" android:color="#ADADAD"></item>
    <item android:color="#2E2E2E"/>
</selector>

      

in a file named selector_transparent_button.xml

in res/drawable/

(I created a drawing directory myself, such as drawable-hdpi, drawable-ldpi were there but weren't available, a quick web search showed that I could create it if it mattered at all).

Problem 2: -

Error: Error: No resource found that matches the specified name (in 'drawable' with value '@ drawable / button_pressed').

Error: Error: No resource was found that matches the specified name (in 'drawable' with value '@ drawable / button_focused').

Error: Error: No resource was found that matches the specified name (in 'drawable' with value '@ drawable / button_default').

+3
android button android-widget android-custom-view borderless


source to share


No one has answered this question yet

See similar questions:

109
How do I create standard Borderless buttons (as pointed out in the design guide)?

or similar:

746
Error getting parent for element: no resource found that matches the specified name after updating to AppCompat v23
207
No resource was found that matches the specified name: attr 'android: keyboardNavigationCluster'. when upgrading to Support Library 26.0.0
40
Error getting parent for element: no resource found that matches the specified name 'android: TextAppearance.Material.Widget.Button.Borderless.Colored'
nineteen
Error: The resource was not found that matches the specified name (in the "icon" with the value "@ drawable / icon")
2
Resource not found matching color / holo_blue_dark
2
No resource found that matches the specified name (in 'drawable' with value '@ drawable / common_google_signin_btn_icon_light_normal_background')
2
No resource found that matches the specified name: attr 'homeHint'
1
android styles.xml no resource found that matches the specified name: attr
0
No resource found that matches the specified name: attr 'middleBarArrowSize'
0
No resource found that matches the specified name (in 'src' with value '@ drawable / img_compass')



All Articles
Loading...
X
Show
Funny
Dev
Pics