0

in this question i Found the following code Android: I am unable to have ViewPager WRAP_CONTENT

<view
android:layout_width="match_parent"
android:layout_height="wrap_content"
class="de.cybergen.ui.layout.WrapContentHeightViewPager"
android:id="@+id/wrapContentHeightViewPager"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"/>

how i can set class programmatically for ViewPager. i have a code like this:

ViewPager vp = new ViewPager(this);
PagesAdapter dp = new PagesAdapter(this);// this class extends PagerAdapter
vp.setAdapter(dp);

i want to use class (WrapContentHeightViewPager) to set Wrap content height ViewPager.

Community
  • 1
  • 1
adam
  • 181
  • 2
  • 9
  • show us more of your code. This single line you posted tells us nothing about what you want to acheive and what your problem is. – fragon Jan 13 '15 at 19:21
  • please check the link to see class WrapContentHeightViewPager. i want to set wrap_content height for viewpager. i created ViewPager by java code, but in that question by xml!. – adam Jan 13 '15 at 19:26
  • Just use that class instead of `ViewPager`? – corsair992 Jan 13 '15 at 20:01
  • yes yes! how use that class by code java, dont xml ! – adam Jan 13 '15 at 20:11

0 Answers0