0

とのdivider間にを表示するこの xml ファイルがあります。TextViewButton

holoeverywhereライブラリを使用しています。

このコードを使用すると、除算は表示されません

    <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>

今問題はこれらの属性にありますLinearLayout

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

namespaceこれらの属性をこのように変更するandroidと、機能し、仕切りが表示されます。

なにか提案を

4

1 に答える 1

1

android名前空間を使用します。それは良いはずです。

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>

カスタム属性は、android 名前空間で定義されているようです。

org.holoeverywhere.widget.LinearLayout また、ここのソースを見ると、LinearLayoutクラスがattrsLinearLayout_ android _baselineAlignedChildIndex のように上記で定義されたものを使用しているため、android namespace.

于 2013-09-16T22:36:44.153 に答える