compound-drawables Questions

3

How can I place drawableLeft and button text of AppCompatButton like in the image below? I have tried to apply paddingLeft, but the text is moving away from the drawable to the right. <andr...
Thadthaddaus asked 1/12, 2015 at 7:40

41

I have added an image right of the text in an EditText widget, using the following XML: <EditText android:id="@+id/txtsearch" ... android:layout_gravity="center_vertical" android:background...

0

I want to know a view's size before hand. I measure its size this way. public static int[] measureSize(ViewGroup parent, int layoutId) { View view = LayoutInflater.from(parent.getContext()).infla...
Resource asked 8/4, 2020 at 11:26

16

Solved

how can I make the drawable on a button smaller? The icon is too big, actually higher than the button. This is the code I am using: <Button android:background="@drawable/red_button" android:...
Kissie asked 24/9, 2011 at 8:56

17

Solved

When I use VectorDrawable assets in a textview or imageview I get a runtime crash when using "android:DrawableRight" / "android:DrawableEnd" / "android:DrawableStart" / "android:DrawableLeft". The...

4

Solved

Ran the new Lint tool against my code. It came up with a lot of good suggestions, but this one I cannot understand. This tag and its children can be replaced by one and a compound drawable Issue: ...

1

Solved

This question is in a way a continuation of my last question. My problem now is pretty much the same, except that instead of separating the image and text in differend views (namely ImageView and ...
Polyurethane asked 11/9, 2014 at 14:29

2

Solved

I can't figure out how to set the alignment of text and its compound drawable (smaller than text) in a TextView. It seems the default alignment is center, but I need to align them by the edge. PS:...
Haik asked 30/1, 2013 at 14:41

6

I'm trying to achieve the following layout: a fixed width TextView aligned to the left of its parent, with the text inside it aligned to the right side of that TextView (that's why fixed width, can...
Behistun asked 12/2, 2013 at 14:37

3

Solved

I have a ListView populated with an ArrayAdapter. For items I use just a single TextView layout. I want some of the rows to have compound drawables set. Question: is there a way to set padding for ...
Exocarp asked 17/9, 2012 at 8:23

0

We can set compound drawables for textview as below using drawableLeft or setCompundDrawables but using this its only possible to place the drawable on left / right / top / bottom.But i want ...
Wolfson asked 6/2, 2013 at 10:21

2

I can't see any tag to set width Here I set textview height, if I set width it will not work properly. <TextView android:id="@+id/nome" android:layout_width="wrap_content" android:lay...
Saiff asked 8/8, 2012 at 23:9
1

© 2022 - 2024 — McMap. All rights reserved.