首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带有羊皮纸库错误的水平ListView

带有羊皮纸库错误的水平ListView
EN

Stack Overflow用户
提问于 2015-08-20 15:34:05
回答 2查看 293关注 0票数 1

我只是尝试使用羊皮纸库添加一个水平listView,但它对我不起作用。

我按照所有的说明在Eclipse中将羊皮纸作为一个Android库添加,这一步是可以的。问题是,当我试图在xml文件中添加我的水平listView时,Eclipse显示了一个错误:“错误:不允许字符串类型(在‘方向’值‘水平')"

代码语言:javascript
复制
    <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>

你能帮帮我吗

非常感谢

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-08-20 15:41:30

将以下内容添加到根标记xmlns:parchment="http://schemas.android.com/apk/res-auto

另外,以LinearLayout.TextView 60 dp为中心的(垂直文本)也可以简化。

代码语言:javascript
复制
<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" />
票数 0
EN

Stack Overflow用户

发布于 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",请检查以下内容

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32122453

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档