有没有办法使用 Anko 将主题和样式添加到布局中?谢谢
<RelativeLayout
android:id="@+id/rlHeaderLayout"
style="?defaultStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="?topBarThemeContext">
最佳答案
我只是谷歌了同样的问题,并找到了答案 here
主题
Anko 也支持通过在任何 View 或布局之前的 themed
前缀来覆盖主题(xml 方式是添加 android:theme
参数>到任何 View ):
kotlin themedLinearLayout(ThemeOverlay_AppCompat_Dark) {
orientation = VERTICAL
gravity = BOTTOM
}
关于android - Anko 主题和风格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47523380/