gpt4 book ai didi

android - 通过编程实现RadioButton的不同文本大小

转载 作者:搜寻专家 更新时间:2023-11-01 08:43:20 25 4
gpt4 key购买 nike

我用不同大小的文本来显示不同的屏幕分辨率。为此,我创建了一个资源values/dimens.xmlvalues-sw720dp/dimens.xml。但我不知道如何在以编程方式创建dimens.xml时使用RadioButton中的值?

RadioButton newRadioButton = new RadioButton(this);

newRadioButton.setTextSize(30); //how to use the values from dimens.xml?
newRadioButton.setTextColor(Color.parseColor("#002060"));

radiogroup.addView(newRadioButton, layoutParams);

最佳答案

getResources().getDimension(R.dimen.test)

关于android - 通过编程实现RadioButton的不同文本大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30757787/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com