Reinherd
Reinherd

Reputation: 5506

How can I achieve this view?

enter image description here

I've tried using an HorizontalScrollView with a linearLayout inside. It looked exactly like the picture, but I don't want to use that ScrollView because on the launch, the scrolling bar is shown, and this is not what I want.

I've also tried a relativeLayout with every view aligned with each other, but the last view is scaled down, to fit the small space left.

Any tip?

Upvotes: 2

Views: 105

Answers (4)

Murali Ganesan
Murali Ganesan

Reputation: 2955

Try this, You can enable or disable scrolling bar using this setHorizontalScrollBarEnabled()

Scrool.setHorizontalScrollBarEnabled(true)

Upvotes: 3

Reinherd
Reinherd

Reputation: 5506

Found out a solution:

Created a RelativeLayout with a Horizontal LinearLayout inside. The RelativeLayout (the highest parent) with a width of 1500dp. Then nothing is scalled.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="1500dp"
    android:layout_height="fill_parent"
    android:orientation="vertical" 
    android:background="#ffffffff">

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/techinc_splash_1" />
    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/techinc_splash_1" />
    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/techinc_splash_1" />
</LinearLayout>
</RelativeLayout>

Upvotes: 0

Kumar Bibek
Kumar Bibek

Reputation: 9117

Gallery is being deprecated. So, the recommended way to achieve this would be HorizontalScrollView. You can turn on/off the scrollbars if you want them not to be shown during launch, and then, after launch turn them on.

This class was deprecated in API level 16. This widget is no longer supported. Other horizontally scrolling widgets include HorizontalScrollView and ViewPager from the support library.

Upvotes: 1

Prateek
Prateek

Reputation: 4013

Why don't you give a try to andoid Gallery View. That I guess would suffice your need as far as I can visualize it.

Upvotes: 0

Related Questions