开发者

Android GUI where different panels are shown/hidden based on context?

I'm making a drawing app. In the cen开发者_开发技巧tre of the screen, I want the app to contain the user's drawing. At the top of the screen I want buttons for different drawing tools. When a drawing tool is selected, I want buttons specific to that tool to appear at the bottom of the app (e.g. the brush tool might show a "increase brush size" button at the bottom of the screen), replacing what buttons might be there from before. What's a good way to do this?

At the moment, I'm using a relative layout for the whole GUI, then adding a separate linear layout for each tool panel at the bottom of the screen (i.e. the panels overlap when shown together). When a tool button is clicked, I hide all the settings panels except for the one related to the selected tool. This seems a bit messy but I'm not sure how else to do it. It would be nice if I could do it in a way that keeps the code modular for each tool.


Use a ViewSwitcher for your tools.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜