2016-12-09 26 views
-2

通常のリストビューを作成しますが、ユーザーフレンドリーではありません。私はGoogleで検索し、リストビューのこの写真を見つけると、このようなリストビューを作成するのが好きです。 私はちょうどこのようなボクシングを作る必要があります、影と3dのような! enter image description hereこのようなリストビューのUIを作成する方法

これは私のXMLコードです:

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

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 

    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:gravity="center" 
    android:orientation="horizontal" 
    android:padding="5dp" 
    android:divider="#a31405"> 

    <LinearLayout 

     android:layout_width="238dp" 
     android:layout_height="wrap_content" 
     android:layout_marginRight="10dp" 
     android:layout_marginLeft="5dp" 
     android:textDirection="rtl" 
     android:layoutDirection="rtl" 

     android:orientation="vertical" > 

     <TextView 

      android:id="@+id/text" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Title" 
      android:layout_gravity="right" 
      android:textDirection="rtl" 
      android:textAppearance="?android:attr/textAppearanceMedium" 
      android:fontFamily="sans-serif" 
      android:textSize="18sp" 
      android:textAlignment="textEnd" /> 

     <TextView 
      android:id="@+id/text_category" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="right" 
      android:text="Category" 
      android:textAppearance="?android:attr/textAppearanceSmall" /> 

     <TextView 
      android:id="@+id/second" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="30:00" 
      android:textAppearance="?android:attr/textAppearanceSmall" /> 

    </LinearLayout> 

    <ImageView 
     android:id="@+id/picture" 
     android:layout_width="140dp" 
     android:layout_height="90dp" 
     android:src="@mipmap/ic_launcher" 
     android:scaleType="centerCrop" 
     android:contentDescription="@string/desc"/> 

</LinearLayout> 

私のアプリは、オンラインデータベースを使用したWebベースのアプリケーションやワークです。 ありがとうございます。

+2

あなたはこれまでに何をしましたか?あなたが直面している問題は何ですか?これは、カスタムアダプターとアイテムの単純なリストビューです。 – Rohit5k2

+0

@ Rohit5k2はこのようなボクシングをする必要があります、影と3dのような!私のlistviewは非常に非常に単純です、ちょうどイメージとテキストと仕切り、このような効果はありません。 – user2003857

+0

imageView画像を選択する際に変更する必要があります。またはいずれかの画像で2つの画像ビューを保持し、一度に可視にすることができます – Vinodh

答えて

0

CardViewを使用すると、ドロップシャドウ(elevation)とcorner radiusのカードスタイルで情報を表現でき、プラットフォーム全体で一貫性があります。 CardViewはFrameLayoutを拡張し、Android 2.xに戻ってサポートされています。

と組み合わせると、見栄えの良いUIを実現できます。CardViewと組み合わせてください。

linkを参照してください。

0

ドロップシャドウListViewにはCardviewRecylerViewを使用できます。サンプルプロジェクトのためにリンクの下を参照してください:

Sample1Sample2

関連する問題