我只是尝试使用羊皮纸库添加一个水平listView,但它对我不起作用。
我按照所有的说明在Eclipse中将羊皮纸作为一个Android库添加,这一步是可以的。问题是,当我试图在xml文件中添加我的水平listView时,Eclipse显示了一个错误:“错误:不允许字符串类型(在‘方向’值‘水平')"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<View
android:layout_width="wrap_content"
android:layout_height="60dp"
android:background="#ff5a5bff"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="List App"
android:textColor="#fff"
android:textSize="25sp"
android:gravity="center_vertical"
android:layout_centerInParent="true"/>
</RelativeLayout>
<mobi.parchment.widget.adapterview.listview.ListView
xmlns:parchment="http://schemas.android.com/apk/res/res-auto"
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="200dp"
android:clipToPadding="true"
android:drawSelectorOnTop="false"
parchment:orientation="horizontal"
parchment:snapPosition="start"/>
</LinearLayout>你能帮帮我吗
非常感谢
发布于 2015-08-20 15:41:30
将以下内容添加到根标记xmlns:parchment="http://schemas.android.com/apk/res-auto中
另外,以LinearLayout.TextView 60 dp为中心的(垂直文本)也可以简化。
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:parchment="http://schemas.android.com/apk/res-auto">
<TextView
android:layout_width="wrap_content"
android:layout_height="60dp"
android:text="List App"
android:background="#ff5a5bff"
android:textColor="#fff"
android:textSize="25sp"
android:gravity="center_vertical" />发布于 2015-08-20 15:40:49
在文档中,xmlns是:xmlns:parchment="http://schemas.android.com/apk/res/<YOUR PACKAGE NAME>",在您的代码中是:xmlns:parchment="http://schemas.android.com/apk/res/res-auto",请检查以下内容
https://stackoverflow.com/questions/32122453
复制相似问题