Share to EffectHub.com

You can earn money or coins from your share:)

Tips: you can use Sparticle for uploading away3D effects.

Tips: you can download Sparticle for uploading effects.

Tips: The ActionScript editor is supporting Away3D, Starling, Dragonbones and Flex frameworks.

Tips: paste the web page URL then click button:)

EffectHub.com: Your Best Source for Gaming
Login    or

Android:How to fix GridView in ScrollView can only show one line

As we known ,GridView in ScroolView or ListView will only show oneline.

The follow code will solve this problem 

import android.content.Context;import android.util.AttributeSet;import android.widget.GridView;public class ScrollerGridView extends GridView {	    private boolean haveScrollbar = true;   	    	    public ScrollerGridView(Context context) {   	        super(context);   	    }   	    public ScrollerGridView(Context context, AttributeSet attrs) {   	        super(context, attrs);   	    }   	    public ScrollerGridView(Context context, AttributeSet attrs, int defStyle) {   	        super(context, attrs, defStyle);   	    }   	    /**  	     * Set whether has ScrollView .Set false when you need show in scrollView .Default value is true 	     *   	     * @param haveScrollbars  	     */   	    public void setHaveScrollbar(boolean haveScrollbar) {   	        this.haveScrollbar = haveScrollbar;   	    }   	    	    @Override   	    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {   	        if (haveScrollbar == false) {   	            int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);   	            super.onMeasure(widthMeasureSpec, expandSpec);   	        } else {   	            super.onMeasure(widthMeasureSpec, heightMeasureSpec);   	        }   	    }   }



...

You must Sign up as a member of Effecthub to view the content.

3707 views    2 comments

You must Sign up as a member of Effecthub to join the conversation.

ChOw

A PHP Error was encountered

Severity: Notice

Message: Undefined index: HTTP_ACCEPT_LANGUAGE

Filename: helpers/time_helper.php

Line Number: 22

2014-02-12
>>Back to Android group


Latest Posts


Sponsor


They are waiting for your help



Share

Join Effecthub.com


Or Login with Your Email Address:

Or Sign Up with Your Email Address:
This field must contain a valid email
Password should be at least 1 character

A PHP Error was encountered

Severity: Notice

Message: Undefined index: HTTP_ACCEPT_LANGUAGE

Filename: views/footer.php

Line Number: 6

A PHP Error was encountered

Severity: Notice

Message: Undefined index: HTTP_ACCEPT_LANGUAGE

Filename: controllers/topic.php

Line Number: 21

A PHP Error was encountered

Severity: Notice

Message: Undefined index: HTTP_ACCEPT_LANGUAGE

Filename: controllers/topic.php

Line Number: 85