How to implement horizontal scroll for toolbar in android?

        LinearLayout standardtoolbar = new LinearLayout(context);
        Bitmap toolbarBackgroundImage = SkinManager.getInstance().getImageBitmap("BarBackground");
        Drawable d = new BitmapDrawable(toolbarBackgroundImage);
        RelativeLayout.LayoutParams lpstandardtool = new RelativeLayout.LayoutParams(5, LayoutParams.WRAP_CONTENT);
        toolbarLayout.addView(standardtoolbar, 0);
        toolbarLayout.scrollBy(5, 0);
        ScrollView scroll = new ScrollView(AppController.getInstance().getCurrentActivity());

the scroll view is not working for the given layout. The commented code was written for horizontal scroll view. But its not working.


in your xml file example.xml

<HorizontalScrollView xmlns:android=""
android:layout_height="wrap_content" android:layout_width="wrap_content>  

   <LinearLayout android:id="layout" android:layout_height="wrap_content" android:layout_width="wrap_content" android:orientation="horizontal">


in java code

LinearLayout standardtoolbar = (LinearLayout)findViewById(;
layout.addView(standardtoolbar, 0);

Need Your Help

Writing an unmanaged DLL to be used in a .NET project: best practices

integration unmanaged

I'm planning on implementing a performance-critical part of an otherwise completely managed project in C (or C++). What are the best practices (concerning method signatures, calling conventions, wh...

Django templates - Reusable fragment with flexible name

django django-templates

I have a reusable HTML fragment that I use to list items. So to list items in a view I just do:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.