Problems with ListView colors - android

this is how I like that the application be
but when I slip a finger through the list it looks like
how do I change from black to transparent? Thanks

Maybe in the XML file in the part where your transparency will be.
android:background="#66000000" android:cacheColorHint="#00000000"
First 2 numbers control transparency.

Related

Android list items overlap listview borders

I am working with the simple ListView. Need to make this ListView round (not the every list item round, but the ListView itself). So for this purpose I use shape xml-file. It looks like that:
The problem appears when I need to change color of the items. This color overlaps border of the listview. And it looks something like that:
As you can see, the listView is square again, not rounded. How can I prevent this? Couldn't found the solution though it seems a pretty much common thing to me.
If you want to add space around you list item add in you list item layout..
android:paddingTop="2dp"
android:paddingRight="2dp"
android:paddingLeft="2dp";
android:paddingBottom="2dp";
or
android:padding="2dp"
Use padding in listview..
android:padding="5dp"

What is the small graphic displayed under an EditText called and how can I remove it?

After some pretty thorough googling I still cannot figure out what the the little graphic that's displayed under the text in and EditText View is called. I would also like to remove it either using XML or programmatically. The little graphic is the thing under the cursor in this image: http://1.bp.blogspot.com/-UAuOq0h4Vok/T8reinvaWPI/AAAAAAAABPc/N4yibXd3kZg/s1600/android%2Bedittext%2Btext%2Bchange%2Blistener%2Bexample.jpg . Sorry if this is a dumb question, but without the name of this little graphic feature I can't seem to find out anything about it.
It is the background drawable associated with the edittext. You can change it by manually setting the background to something yourself, such as
<EditText
android:background="#android:color/transparent"
...
/>
Try this..
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="#string/hello"
android:background="#00000000"
/>
if you want transparancy just put 80 before the actual hash code.
#80000000
This will change any colour you want to transparent one.. :)
you probably have in your layout
android:minLines="2"
try to remove it

Android imagebutton: how to remove tinted rectangle around image?

I'm developing and Android app. I have a main menu with lots of imagebuttons, each of which takes the user to a new view on click.
The problem I'm having is that surrounding each icon is a tinted rectangle that changes to a light blue colour when tapped. How do I remove this transparent square in the .xml layout file?
Many thanks in advance,
they probably have the default background from the android system. to remove that, define a transparent color
<color name="transparent">#00000000</color>
and then use it as background in your buttons
<ImageButton android:src="#drawable/button"
android:background="#color/transparent"/>
I think it will work the way you want
You could always use the framework's
android:background="#android:color/transparent"
But for what you are trying to archive this is the better solution:
android:background="#null"
I know theres now rectangle or colour, when you use your own buttons.. create, implement and use them, then you wont have the rectangle

Would it be possible to let the user customize the color of a .9 drawable?

Pretty much what the title says. I'm wanting the user to have the choice to customize the boarder of a 9 drawable I have. Is something like that possible or do I need to use a different method? Right now, I think it won't work and it will mess up the 9 patch.
Can you post a picture of your 9-patch? It might be possible to extract parts of it to another type of drawable, then layer the customizable part (drawn with user defined color) under the fixed portions using a layer-list.
[Update] Based on the pic you posted, I'd trash the layer list idea, but we can still work something out. The idea would be to remove the colored border and internal dark background from the 9-patch entirely (fill that area in with the shadow color and opacity). Then nest 3 layouts in each other. The first would use the 9-patch as a background. The second would use the user-defined color as a background. The third would use your panel color as a background. The 9-patch would provide the proper margins to position the second (user-color) layout, and then you'd just add a layout_margin attribute to the second panel to position the inner most layout a few dps in.
<LinearLayout
android:id="#+id/PanelOuter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/shadow_nine_patch">
<LinearLayout
android:id="#+id/PanelUserBorder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="#dimen/custom_border_width"
android:background="#color/dialog_border_color_default">
<LinearLayout
android:id="#+id/PanelContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="#dimen/custom_dialog_content_margin"
android:background="#color/dialog_inner_color">
</LinearLayout>
</LinearLayout>
</LinearLayout>
Of course, you'd be responsible for finding the PanelUserBorder view in code and calling setBackgroundColor() with the proper user-defined color.
maybe you could tint it by putting a 50% transparent view overtop the button.
after thinking about it i thought maybe you could transform the color by bitmap:
How to change Bitmap image color in android?

Android listview produces black highlighting over text when scrolling. How to stop this?

Duplicate:
Background ListView becomes black when scrolling
I have a listview within which each item contains black text on a white background. When testing on a Nexus One, when scrolling down to read through the text, a black highlight appears over the text and makes it unreadable.
I am trying to figure out what is this setting so I can turn it off. I do not want anything to get highlighted when scrolling down through the list. How can I accomplish this?
Thanks.
You probably want to set the cacheColorHint to the same color as your background.
So, when you're defining your layout, just add android:cacheColorHint='#fff' to your ListView:
<ListView android:id="#+id/list"
android:cacheColorHint="#fff"
android:background="#fff"
...etc />
This may be a trick:
android:cacheColorHint="#android:color/transparent"
Another solution would be to set the backgroundcolor of your list to transparent.
I had the same issue and setting the android:cacheColorHint to transparent seems to do the trick

Categories

Resources