【问题标题】:Custom listview vertical line doesn't show up自定义列表视图垂直线不显示
【发布时间】:2015-06-22 07:12:37
【问题描述】:

除了垂直线之外的所有东西都是可见的。这是代码。

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/verses_custom_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<com.ad.holyquran.extra.TextViewEx
    android:id="@+id/textView_Verse"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_toRightOf="@+id/versesRelativeLayout"
    android:gravity="right"
    android:layout_marginTop="-10dp"
    android:paddingBottom="5dp"
    android:paddingLeft="5dp"
    android:paddingRight="10dp"
    android:text="Text"
    android:textSize="30sp"
    android:textColor="#ff000000" />

<TextView
    android:id="@+id/textView_VerseTranslation"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/textView_Verse"
    android:paddingBottom="5dp"
    android:paddingLeft="5dp"
    android:layout_toRightOf="@+id/versesRelativeLayout"
    android:paddingRight="10dp"
    android:paddingTop="5dp"
    android:text="Text"
    android:textSize="20sp" />

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/versesRelativeLayout"
    android:layout_alignParentLeft="true">

    <ImageView
        android:id="@+id/versesImageView"
        android:layout_alignParentTop="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_verse" />

    <TextView
        android:id="@+id/textView_verseNumber"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/versesImageView"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="280"
        android:paddingBottom="16dp"
        android:textSize="14sp"
        android:textColor="#ff000000" />
    <View
        android:id="@+id/view"
        android:layout_width="2dp"
        android:layout_height="match_parent"
        android:background="#ff008328"
        android:layout_alignRight="@+id/versesImageView"
        android:layout_alignParentRight="false"
        android:layout_alignWithParentIfMissing="false" />

</RelativeLayout>

但是它显示在 XML 的设计视图中,请查看下面的链接,但它不会显示在我的实际 (GS3-I9300) 设备上。 http://i60.tinypic.com/jz9kpf.jpg

【问题讨论】:

  • 您能否将您在真实设备上获得的快照发送给我们?
  • 我得到了除了那条垂直线之外的所有东西。
  • 不知道您系统中的什么问题我粘贴了相同的代码,它完美地显示了绿色垂直线。

标签: android listview custom-lists


【解决方案1】:

-你好,这里是我粘贴了你的相同代码的快照,我得到了这个屏幕。 - 见绿色垂直线。

【讨论】:

  • 谢谢,我在设计视图中也看到了,但是当我在实际设备上运行它时,垂直线消失了,而其余的都在那里。
  • 您好,即使我在运行时也得到相同的输出。请尝试更改垂直线的颜色和宽度并再次检查。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-01-08
  • 1970-01-01
  • 1970-01-01
  • 2016-04-11
  • 1970-01-01
  • 2021-12-19
相关资源
最近更新 更多