Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (4k points)

I have this field:

HashMap<String, HashMap> selects = new HashMap<String, HashMap>();

For each Hash<String, HashMap> I need to create a ComboBox, whose items are the value (which happens to be a HashMap itself) of HashMap <String, **HashMap**>.

By way of (non-functioning) demonstration:

for (int i=0; i < selects.size(); i++) {

    HashMap h = selects[i].getValue();

    ComboBox cb = new ComboBox();

    for (int y=0; y < h.size(); i++) {

        cb.items.add(h[y].getValue);

    }

}

1 Answer

0 votes
by (46k points)

 Here's what described in the documentation, by default it uses the color set in styles.xml attribute colorAccent.

The background color of this aspect defaults to your theme's colorAccent. If you want to modify this at runtime then you can do so via setBackgroundTintList(ColorStateList).

If you want to modify the color:

in XML with attribute app:backgroundTint

<android.support.design.widget.FloatingActionButton

    xmlns:app="http://schemas.android.com/apk/res-auto"

    android:layout_width="wrap_content"

    android:layout_height="wrap_content"

    android:src="@drawable/ic_add"

    app:backgroundTint="@color/orange"

    app:borderWidth="0dp"

    app:elevation="6dp"

    app:fabSize="normal" >

if you want to modify the icon color, you can try

android:tint="@color/colorname"

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Aug 26, 2019 in Java by Krishna (2.6k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...