Android 是否可以在样式中设置约束布局特性?
当我在活动的xml源中设置以下约束布局属性时,我得到了预期的结果,但当我在样式中设置它们时,设置的值根本不会得到处理Android 是否可以在样式中设置约束布局特性?,android,Android,当我在活动的xml源中设置以下约束布局属性时,我得到了预期的结果,但当我在样式中设置它们时,设置的值根本不会得到处理 <style name="vrm_entry_number_button" parent="@android:style/Widget.Button"> <item name="android:layout_margin">7dp</item> <item name="android:background">#496
<style name="vrm_entry_number_button" parent="@android:style/Widget.Button">
<item name="android:layout_margin">7dp</item>
<item name="android:background">#496587</item>
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">0dp</item>
<item name="app:layout_constraintHeight_default">percent</item>
<item name="app:layout_constraintHeight_percent">0.90</item>
<item name="app:layout_constraintWidth_default">percent</item>
<item name="app:layout_constraintWidth_percent">0.10</item>
</style>
7dp
#496587
0dp
0dp
百分比
0.90
百分比
0.10
这可能是什么原因?还有其他选择吗 按以下步骤操作,它应该会工作
<style name="vrm_entry_number_button" parent="@android:style/Widget.Button">
<item name="layout_constraintHeight_default">percent</item>
<item name="layout_constraintHeight_percent">0.90</item>
<item name="layout_constraintWidth_default">percent</item>
<item name="layout_constraintWidth_percent">0.10</item>
</style>
百分比
0.90
百分比
0.10