Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right side getting cut off #15

Open
dwalintukan opened this issue May 29, 2015 · 2 comments
Open

Right side getting cut off #15

dwalintukan opened this issue May 29, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@dwalintukan
Copy link

I am using the FlowLayout in a ScrollView and the right side of the layout is getting cut off. Not sure if this is related it to being in a ScrollView or not.

The last entry is getting cut off too.

I am programmatically adding TextViews to the FlowLayout:

private void updateMoviesTvTags() {
    moviesTvContainer.removeAllViews();

    for (int i = 0; i < 50; i++) {
        CustomTextView tag = new CustomTextView(getActivity());

        FlowLayout.LayoutParams lp = new FlowLayout.LayoutParams(FlowLayout.LayoutParams
                .WRAP_CONTENT, FlowLayout.LayoutParams.WRAP_CONTENT);
        lp.setMargins(0, 0, 10, 10);
        tag.setLayoutParams(lp);

        tag.setBackground(getResources().getDrawable(R.drawable.tag_bg));
        tag.setText("test");
        tag.setTextSize(16);
        tag.setTextColor(getResources().getColor(R.color.primary_blue));
        tag.setPadding(10, 10, 10, 10);
        moviesTvContainer.addView(tag);
    }
}

<com.wefika.flowlayout.FlowLayout
                android:id="@+id/movies_tv_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="start|top"
                android:padding="10dp"/>

screenshot_2015-05-28-21-12-34

@blazsolar blazsolar added the bug label May 29, 2015
@prakashgowinji
Copy link

Try adding margin for all sides : Change your line from lp.setMargins(0, 0, 10, 10); to lp.setMargins(10, 10, 10, 10);

@blazsolar blazsolar added this to the 1.0 milestone Sep 8, 2015
@blazsolar blazsolar self-assigned this Sep 8, 2015
@LittleHuba
Copy link

Could it be that you set padding in your XML-Layout? I got the same problem if I add padding to the FlowLayout. Without the padding everything is working correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants