0

Hello I am working with android.I have a custom imageview.I want to hide partial imageview behind the screen. I tried padding=-100... etc. But its not working .How can I hide a view partially behind screen ?

2 Answers2

1

use negative margin to parent layout like this, its working

<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:layout_marginTop="-20dp"** >

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/ic_launcher" />

</RelativeLayout>
Divyang Panchal
  • 1,889
  • 1
  • 19
  • 27
0

You need to create your view through java or make a drawable of semicircle and set it as background of imageview.

Refer this: Semicircle drawable

Community
  • 1
  • 1
WISHY
  • 11,067
  • 25
  • 105
  • 197