nirhart / ParallaxScroll

Parallax ScrollView and ListView for Android
MIT License
847 stars 187 forks source link

Weird issue with TextView as listheader #17

Closed w3z315 closed 10 years ago

w3z315 commented 10 years ago

Hey there, I have added a ListViewScroll with a textview as header and changed the size of the textview to 400. The listview is shown pretty weird:

w3z315 commented 10 years ago

https://docs.google.com/file/d/0ByDhPBmg7sYebWlmeWIwQnRpRlk/edit?usp=docslist_api

nirhart commented 10 years ago

Hi Cyruxx, can you verify that your actionbar style is not floated - as it seems that the textview is behind it, and that you are not settings a fixed height to the textview

w3z315 commented 10 years ago

Take a look at https://drive.google.com/file/d/0ByDhPBmg7sYecTRkdFd1c2RVVlk/edit?usp=sharing

That will describe my problem.

// Parallax listview
                            TextView v = new TextView(getActivity());
                            // Set username
                            v.setText(settings.getString("username", getString(R.string.placeholder_username)));
                            v.setGravity(Gravity.CENTER);
                            v.setTextSize(50);
                            v.setTextColor(getResources().getColor(R.color.white));
                            v.setAllCaps(true);
                            v.setHeight(400);
                            v.setBackgroundResource(R.color.bp_red);
                            listHeaderView = v;
                            profileListView.addParallaxedHeaderView(listHeaderView);
nirhart commented 10 years ago

got it, 2 more things, whats the android version/device that you are using and what is the parallax factor that you are using (if non then you are using the default) ?

w3z315 commented 10 years ago

I'm using android 4.4.3 on a HTC One M8 with parallaxfactor 5

If i use default it would look like: https://drive.google.com/file/d/0ByDhPBmg7sYeOVpwT2g1NTBTZjA/edit?usp=sharing

It probably should be more like the "Scroll view single parallaxed item" in your example app..

nirhart commented 10 years ago

oh I see. I definitely need to define a maximum factor or to fix the behaivour of big factors, in the meantime, you can leave it with a default factor (1.9) and set a background color for all of your other items (the ones that go over the header), that way it will look good, like the demo app.

w3z315 commented 10 years ago

Thank you! I was missing a background on the listview items. Now it works as expected!