简体   繁体   English

ToolbarAndroid中的下拉图标+捕捉标题点击事件+搜索输入(反应原生)

[英]Dropdown icon in ToolbarAndroid + catching title tap event + search input (react native)

So I am trying to set a normal, native android toolbar navigation with pretty standard behaviour... I seem to not be able to find examples or instructions in the DOCS how to make them 所以我试图用相当标准的行为设置一个普通的原生android工具栏导航......我似乎无法在DOCS中找到如何制作它们的示例或说明

  • Dropdown icon in the title 标题中的下拉图标

so, first thing to sort out would be the dropdown... I would like to have saying: May ^... (basically to display whatever icon after the title- possibly with custom margin) ... 所以,首先要理清的是下拉菜单......我想说:May ^ ...(基本上可以显示标题后面的任何图标 - 可能带有自定义边距)...

couldn't find an example, but this is a pretty common practice 找不到一个例子,但这是一种很常见的做法

  • Catching the title tap event 抓住标题点击事件

obviously I want then to open a calendar drop down, or whatever other action I want after the title has been tapped. 显然我想要打开日历下拉菜单,或者在点击标题后我想要的任何其他动作。 There are onIconClicked and onActionSelected events but not onTitleClicked event... any ideas? 有onIconClicked和onActionSelected事件,但没有onTitleClicked事件......任何想法?

  • And finally.. Search box 最后.. 搜索框

in the actions I have a 'search' icon, that ideally I want the search input box to appear in the toolbar (instead of the title)... again, pretty standard practice (similar to google play app or any other major app with material design) 在动作中我有一个'搜索'图标,理想情况下我希望搜索输入框出现在工具栏中(而不是标题)...再次,相当标准的做法(类似于谷歌播放应用程序或任何其他主要应用程序与材料设计)

Thanks for the help! 谢谢您的帮助!

Turns out is quite simple... leave the Title property empty 结果很简单......将Title属性保留为空

  1. <ToolbarAndroid ...> custom content </ToolbarAndroid>
  2. just wrap "custom content" in TouchableHighlight 只需在TouchableHighlight中包装“自定义内容”即可
  3. Just put whatever you need in "custom content" 只需在“自定义内容”中添加所需内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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