In this example, several files are missing. Namely:
In the layout folder: it should have main.xml, okcancelbar.xml and okcancelbar_button.xml. In the values ββfolder: it should have attrs.xml
The contents for main.xml and okcancelbar.xml are shown in the sample article. In okcancelbar_button.xml, you need to define one button as:
<?xml version="1.0" encoding="utf-8"?> <Button xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/button" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> </Button>
And attrs.xml should provide a label definition:
<resources> <declare-styleable name="OkCancelBar"> <attr name="okLabel" format="string" /> <attr name="cancelLabel" format="string" /> </declare-styleable> </resources>
Then everything should come together.
source share