2016-07-06 3 views
1

私は同じタイプのListViewアイテムのすべてのグループでカスタマイズされたListViewを達成しようとしています。このグループの最初のアイテムの上にボタン/バブルのバッジがあります。私は項目タイプのグループは、スクロールアップして、それを達したときに変更するには、ツールバー上の主なバブルを切り替える方法を知ってみたい可能であれば項目タイプにバブルのようなバッジを付けてリストビューを達成していますか?

Image

:それは次のようになります。画像ボタンを使用してレイアウトのSRC =」 "

例:

答えて

2

は、ボタンを アンドロイドで開催したい画像を追加画像ボタンに

を使用してみてください。

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    tools:context="com.example.shakthivels.assignment_8.FormActivity" 
    android:id="@+id/rl" 
    > 


    <EditText 
     android:layout_width="120sp" 
     android:layout_height="wrap_content" 
     android:id="@+id/editText" 
     android:layout_alignParentTop="true" 
     android:layout_alignParentStart="true" 
     android:hint="Name" /> 

    <EditText 
     android:layout_width="100sp" 
     android:layout_height="wrap_content" 
     android:id="@+id/editText2" 
     android:layout_alignBottom="@+id/editText" 
     android:layout_centerHorizontal="true" 
     android:hint="Height" 
     android:inputType="numberDecimal" 
     android:layout_alignParentTop="true" /> 

    <EditText 
     android:layout_width="120sp" 
     android:layout_height="wrap_content" 
     android:id="@+id/editText3" 
     android:layout_alignParentTop="true" 
     android:layout_alignParentEnd="true" 
     android:hint="Swag %" 
     android:inputType="number|numberDecimal" 
     android:layout_above="@+id/button" /> 

    <Button 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="New Button" 
     android:id="@+id/button" 
     android:layout_centerHorizontal="true" 
     android:onClick="onclickbutton" 
     android:layout_below="@+id/editText" /> 

    <android.support.v7.widget.RecyclerView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:id="@+id/view" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentStart="true" 
     android:layout_marginTop="150sp" 
     android:clickable="true" 
     android:onClick="DisplayName" 
     android:contextClickable="true" /> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/textView4" 
     android:layout_below="@+id/button" 
     android:layout_toStartOf="@+id/editText3" 
     android:layout_alignParentEnd="true" /> 
    <ImageButton 
     android:layout_width="70dp" 
     android:layout_height="70dp" 
     android:src="@mipmap/ic_launcher" 
     android:id="@+id/imageButton" 
     android:layout_gravity="right|bottom" 
     android:layout_marginLeft="15dp" 
     android:layout_marginRight="15dp" 
     android:layout_alignParentBottom="true" 
     android:layout_alignEnd="@+id/editText3" 
     android:onClick="RemoveFirst" /> 

</RelativeLayout> 
+0

本当に私の質問には答えません –

関連する問題