質問

I'm trying to implement a ExpandableListView in java that when click deployment space elements inside, not the typical wish list allows choosing an option. What I try to do is basically something like this

enter image description here

One can see that the spinner "wraps" to have items and does not have a list, Would I could help a little?

役に立ちましたか?

解決

You can use ExpandableListView .. check this tutorial http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/

他のヒント

You can easily create one on your own. Just create a Button and assign a Layout below. When the Button gets clicked set the View of you Layout to Visible and otherwise to Invisible. Additionaly you can set up and down arrows to the right of your Button.

final Button button = (Button) findViewById(R.id.button);
        final LinearLayout linearLayout= (LinearLayout) findViewById(R.id.linearLayout);
        linearLayout.setVisibility(View.GONE);

        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                if (linearLayout.getVisibility() == View.VISIBLE) {
                    linearLayout.setVisibility(View.GONE);
                    button.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.expand, 0);

                } else {
                    linearLayout.setVisibility(View.VISIBLE);
                    button.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.collapse, 0);
                }
            }
    });
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top