Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
149 views
in Technique[技术] by (71.8m points)

android - Is it possible to dynamically change my margins depending on the internal paddings of a view?

In a TextView, the text starts pretty close to the start of the View itself. However, That isn't true for every view that contains text. A spinner for example seems to have 8dp of internal padding.

The problem with this is that, if I give every view the same margin, it doesn't look like the views are correctly aligned. Is it possible to dynamically reduce my margins to align the text in all the views?

question from:https://stackoverflow.com/questions/66051958/is-it-possible-to-dynamically-change-my-margins-depending-on-the-internal-paddin

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...