[英]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.