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 ?
Asked
Active
Viewed 757 times
0
-
Hi could you be a bit more clear about what you want to achieve and if possible provide some reference image for it. – WISHY Apr 24 '15 at 05:54
-
i have a circle . I am looking to hide partially bahind screen to make it a semi circle – Carlos Antonio Apr 24 '15 at 06:00
2 Answers
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