Adding text view in horizontal pager
<FrameLayout
android:id="@+id/frame_after_gallery"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<com.sb.Layouts.HorizontalPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ImageViewSwitcher"
android:layout_width="fill_parent"
android:layout_height="280dp"
android:gravity="center"
>
</com.sb.Layouts.HorizontalPager>
<Button
android:id="@+id/btn_previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|left"
android:layout_marginBottom="5dp"
android:padding="10dp"
android:background="@drawable/grayleftarrow">
</Button>
<Button
android:id="@+id/btn_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|right"
andr开发者_开发百科oid:padding="10dp"
android:layout_marginBottom="5dp"
android:background="@drawable/grayrightarrow">
</Button>
</FrameLayout>
This is my xml, i am loading an image view in the horizontal pager, now i want to add a text view below that image view as a subtitle, which moves with the image.how to bring that text view below image view. actually i have to keep both image and text in the same view so moving image also moves the text.
HorizontalPager imagePagingController;
private void loadPagingImages() throws MalformedURLException
{
int totalCount = appdelegate.SportsEntries.allEntries.size();
for (int j = 0; j < totalCount; j++)
{
ImageView view = new ImageView(this);
view.setId(j);
imagePagingController.addView(view);
setImageDownloader(appdelegate.SportsEntries.allEntries.get(j), view);
}
currentpage = imagePagingController.getCurrentScreen();
}
i am loading that image like this in a view. now similarly want to add text view in that pager only below image view.
精彩评论