简体   繁体   English

CollapsingToolbarLayout:以编程方式放置ExpandedText

[英]CollapsingToolbarLayout: position the ExpandedText programmatically

I am using the new Android support design view CollapsingToolbarLayout. 我正在使用新的Android支持设计视图CollapsingToolbarLayout。 I have the need to position the ExpandedTitle programmatically. 我需要以编程方式定位ExpandedTitle。

Actually the only way to set a position for the ExpandedTitle is in the .xml file (example here: https://goo.gl/L5H5FC ) but there is no public api to set the text position programmatically and the fields are all private . 实际上,为ExpandedTitle设置位置的唯一方法是在.xml文件中(示例在这里: https : //goo.gl/L5H5FC ),但是没有公共api可以通过编程方式设置文本位置,并且这些字段均为private

Do you know if it's possible without reflection or any 'hacky' tricks? 您知道没有反思或任何“骇人听闻”技巧的可能性吗?

I have quickly solved my problem exposing the properties via reflection ( https://gist.github.com/fpezzato/8e7d45112883dbbc5ffb ), I works perfectly but I don't like to use this trick in production code. 我已经快速解决了通过反射公开属性的问题( https://gist.github.com/fpezzato/8e7d45112883dbbc5ffb ),我工作得很好,但是我不喜欢在生产代码中使用此技巧。

@Google: please no more private or final stuff! @Google:请不要再发布私人或最终的东西! :) :)

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

相关问题 以编程方式设置collapsingToolbarLayout的高度 - Programmatically set height of collapsingToolbarLayout 以编程方式折叠或展开 CollapsingToolbarLayout - Programmatically collapse or expand CollapsingToolbarLayout 以编程方式设置CollapsingToolbarLayout图像 - Setting CollapsingToolbarLayout image programmatically CollapsingToolbarLayout 字体未以编程方式更改 - CollapsingToolbarLayout typeface not changing programmatically CollapsingToolbarLayout和CollapsingToolbarLayout内的浮动操作按钮位置 - CollapsingToolbarLayout and floating action button position inside CollapsingToolbarLayout 如何以编程方式为CollapsingToolbarLayout设置expandedTitleMarginBottom - How to set expandedTitleMarginBottom for CollapsingToolbarLayout programmatically 防止CollapsingToolBarLayout以编程方式扩展 - Prevent CollapsingToolBarLayout from expanding programmatically CollapsingToolbarLayout以编程方式扩展动画持续时间 - CollapsingToolbarLayout expand programmatically animation duration Android:以编程方式折叠和展开 CollapsingToolbarLayout - Android: Programmatically Collapse and expand the CollapsingToolbarLayout 以编程方式更改 Toolbar 和 CollapsingToolbarLayout 滚动标志 - Changing Toolbar and CollapsingToolbarLayout scroll flags programmatically
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM