简体   繁体   中英

how to make toolbar button bigger than toolbar?

I was wondering how I would go about making a toolbar item (with image) that is taller than the actual toolbar is? In this example the photo button is bigger than the toolbar: 在此输入图像描述

Whenever I try adding an image to a toolbar item it just stretches or shrinks it until it fits the button.

Anyone know how to do this? If you can do this with a tab-bar that would also be fine.

Thanks!

As requested in a comment by the OP, here are the links in an answer. :)

This is not built-in functionality - you will either need to hack the view hierarchy of a UITabBar or UIToolBar to get what you want or write your own equivalent view. Whilst the former approach may be faster, the latter is probably better because messing with the built-in views like that can introduce significant problems should Apple change how they work in future OS releases.

This is a custom toolbar and that's how it can be done in the best way I think. Create an image of a tool bar, create three buttons and make one of them bigger and that should do it.

The above just looks like a graphic super-imposed over the toolbar. Simply add it to the window so it will stay on top of everything.

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