user4o01
user4o01

Reputation: 2698

LinearLayout dividers deos not show up using holoeverywhere

I have this xml file that should display a divider between the TextView and the Button.

I am using holoeverywhere library .

using this code the divide does not show

    <org.holoeverywhere.widget.LinearLayout
                         xmlns:holo="http://schemas.android.com/apk/res-auto"
                         xmlns:android="http://schemas.android.com/apk/res/android"
                        android:id="@+id/topcontainer"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        holo:divider="?attr/dividerVertical"
                        holo:dividerPadding="8dp"
                        android:orientation="horizontal"
                        holo:showDividers="middle" >

                        <org.holoeverywhere.widget.TextView
                            android:id="@+id/textView6"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:layout_weight="1"
                            android:text="@string/str1" />

      <org.holoeverywhere.widget.Button
                            android:id="@+id/add"
                            style="?attr/borderlessButtonStyle"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:text="ADD" />
</org.holoeverywhere.widget.LinearLayout>

now the problem is with these attributes in the LinearLayout

holo:divider="?attr/dividerVertical"
holo:dividerPadding="8dp"
holo:showDividers="middle"

if i change the namespace on these attributes to android like this it works and the divider is shown.

any suggestion

Upvotes: 0

Views: 625

Answers (1)

Varun
Varun

Reputation: 33983

Use the android namespace. That should be good.

As I see the source code of the attrs here.

<declare-styleable name="LinearLayout">
        <attr name="android:baselineAligned"/>
        <attr name="android:baselineAlignedChildIndex"/>
        <attr name="android:divider"/>
        <attr name="android:dividerPadding"/>
        <attr name="android:gravity"/>
        <attr name="android:measureWithLargestChild"/>
        <attr name="android:orientation"/>
        <attr name="android:showDividers"/>
        <attr name="android:weightSum"/>
</declare-styleable>

The custom attrs seems to be defined with the android namespace.

Also, looking at the source of org.holoeverywhere.widget.LinearLayout here you will see that the LinearLayout class is using the above defined attrs like LinearLayout_android_baselineAlignedChildIndex and hence works with the android namespace.

Upvotes: 1

Related Questions