简体   繁体   中英

Overlay part of an imageview over toolbar

I am trying to overlay part of an image view over a toolbar as shown in the below image.

在此处输入图片说明

I have tried using a custom floating action button (using a rectangular canvas) described by Sanjeet Ajnabee here . But, I want only a part of the image to be on the toolbar unlike a floating action button.

Using a dialog wouldn't work as well. I want the image to be part of the layout.

Any idea to start with will help.

That's pretty simple, you just use a NoActionBar style and then a Layout like the pseudo-XML below:

<FrameLayout>
   <Toolbar height="60dp" paddingBottom="12dp"> // here is the Toolbar
   <ImageView marginTop="48dp" /> // marging top = 60-12=48
   <FrameLayout marginTop="60dp">
        // add here the rest of your layout
   </FrameLayout>
</FrameLayout>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM