1

I'm using this library: https://github.com/sephiroth74/HorizontalVariableListView

I need to add the component "it.sephiroth.android.library.widget.HListView" to my layout programmatically.

I've tried this but nothing is visible...

View w;
    w=new it.sephiroth.android.library.widget.HListView(MainActivityDynamic.this);
    w.setMinimumHeight(500);
    w.setMinimumWidth(500);
    w.setBackgroundColor(getResources().getColor(R.color.red));
    linear1.addView(w, 0);

What is wrong?

3
  • What your getting...what is your problem? any exception? Commented Feb 13, 2015 at 13:00
  • Try this w.setVisibility(true); Commented Feb 13, 2015 at 13:11
  • @Chandrakanth no exceptions, my problem is that I want to create that custom view, but when I add it to the root view, it doesn't appear. Commented Feb 16, 2015 at 8:32

1 Answer 1

1

Define your HListView in a XML file, than inflate it in your code and add it programmatically using addView.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.