I have a top bar with a show/hide menu button. I would like to define the top bar, the button and the menu in the same layout.
I tried a layout with the height of the top bar, but the menu is clipped and is not visible. Is that possible to have a view larger than its parent. Otherwise, what's the standard way to do that?
For your question: Yes It's possible. Simple example:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f0f"
android:layout_marginLeft="-50dp"
android:layout_marginRight="-50dp"
/>
</LinearLayout>
And ImageViewWidth == LinearLayoutWidth + 100dp
.
Hope its help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With