Closed hoseinit closed 9 years ago
What is the exact problem?
it's in the title "Error parsing XML: unbound prefix"
You need to add xml namespace to your layout file as below: xmlns:app="http://schemas.android.com/apk/res-auto" to be able to use custom attributes defined in this library.
Hello again I did import the project from both methods mentioned in your website, I noted and already added xml namespace. I even changed build target from 4.2.2 to 4.4 and ... I don't know what else I have to do to make it work. The problem rises when I want to add any styles to the view like app:displayMonthNames="true" without the styles it works
Thank you in advance
Hi Use this sample code. It works for me and is based on the real app (FaraYad):
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- ... -->
<view
android:id="@+id/endDatePickerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
class="ir.smartlab.farayad.widget.PersianDatePicker"
app:displayMonthNames="true" />
Thank you very much. It was kind of you to help me out here
Hi I have imported the project as a Library I face to this problem when I want to add attributes like app:maxYear="1450" to my layout file. without any attributes the simple following tag will work <ir.smartlab.persindatepicker.PersianDatePicker android:layout_width="wrap_content" android:layout_height="wrap_content"/>