zoukankan      html  css  js  c++  java
  • ListView或者RecyclerView中德Item添加分割线的另一种方法

    <?xml version="1.0" encoding="utf-8"?>
    <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    style="@style/News.Card"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@android:color/white"
    android:padding="4dp">

    <TextView
    android:id="@+id/tv_news_summary_title"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_toLeftOf="@+id/tv_news_summary_ptime"
    android:paddingLeft="@dimen/spacing_medium"
    android:paddingTop="@dimen/spacing_medium"
    android:singleLine="true"
    android:textColor="@color/primary_text"
    android:textSize="16sp" />

    <TextView
    android:id="@+id/tv_news_summary_ptime"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_marginRight="@dimen/spacing_medium"
    android:paddingRight="@dimen/margin_0dp"
    android:paddingTop="@dimen/margin_10dp"
    android:textColor="@color/secondary_text"
    android:textSize="14sp" />

    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/tv_news_summary_title"
    android:orientation="horizontal"
    android:padding="@dimen/spacing_medium">

    <ImageView
    android:id="@+id/iv_newsImage1"
    android:layout_width="0dp"
    android:layout_height="84dp"
    android:layout_gravity="center_vertical"
    android:layout_weight="1"
    android:paddingRight="@dimen/margin_4dp"
    android:scaleType="fitXY" />

    <ImageView
    android:id="@+id/iv_newsImage2"
    android:layout_width="0dp"
    android:layout_height="84dp"
    android:layout_gravity="center_vertical"
    android:layout_weight="1"
    android:paddingLeft="@dimen/margin_4dp"
    android:paddingRight="@dimen/margin_4dp"
    android:scaleType="fitXY" />

    <ImageView
    android:id="@+id/iv_newsImage3"
    android:layout_width="0dp"
    android:layout_height="84dp"
    android:layout_gravity="center_vertical"
    android:layout_weight="1"
    android:paddingLeft="@dimen/margin_4dp"
    android:scaleType="fitXY" />

    </LinearLayout>

    <TextView
    android:id="@+id/newsSource"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_below="@+id/tv_news_summary_ptime"
    android:layout_toRightOf="@+id/tv_news_summary_ptime"
    android:paddingBottom="@dimen/spacing_medium"
    android:paddingLeft="@dimen/margin_6dp"
    android:textColor="@color/secondary_text"
    android:textSize="14sp"
    android:visibility="gone" />

    <!--<View-->
    <!--android:id="@+id/divier"-->
    <!--android:layout_width="match_parent"-->
    <!--android:layout_height="@dimen/item_divider_line"-->
    <!--android:layout_marginLeft="@dimen/spacing_medium"-->
    <!--android:layout_marginRight="@dimen/spacing_medium"-->
    <!--android:background="@color/divider" />-->
    </RelativeLayout>
    </android.support.v7.widget.CardView>
  • 相关阅读:
    反射通过控件名返回控件对象
    比较两个datatable是否一样
    计算两个DateTime间的时间差(小时差、分钟差、秒钟差等)
    在IIS中调试程序
    Using TestDriven Development and the RedGreenRefactor Workflow
    WCF单元测试
    模拟发送POST或Get请求
    DES加解密方法(C#和android通用)
    Wcf Rest Service模板方法输入输出流数据
    网游放缓页游疾进 客户端游戏会被取代吗?
  • 原文地址:https://www.cnblogs.com/fightzhao/p/5647526.html
Copyright © 2011-2022 走看看