mardi 18 octobre 2016

CheckBox widget in the top right corner of an image

Currently I am downloading 2 images per row via Picasso. I'd want to add a CheckBox in the top right corner of each of them. How should the checkbox be defined? Here is the layout so far:

<!--Row1-->
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="0dip"
    android:orientation="horizontal"
    android:layout_weight="1">

        <ImageView
            android:id="@+id/img1"
            style="@style/singleImage"
            android:layout_marginRight="10dp"/>


        <ImageView
            android:id="@+id/img2"
            style="@style/singleImage"/>
</LinearLayout>

And the style:

<style name="singleImage">
    <item name="android:layout_width">0dp</item>
    <item name="android:layout_height">wrap_content</item>
    <item name="android:layout_weight">1</item>
</style>




Aucun commentaire:

Enregistrer un commentaire