-
Notifications
You must be signed in to change notification settings - Fork 623
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
views mismatch #17
Comments
@micheltabib you can try demo load image(I use Picasso),it work to me.you can upload your screen picture and your code,I will try.thanks. |
@Frank-Zhu thank you for you reply. but i found another issue. here is a screenshots of the issue followed by the code. this is how the screen should look like this is how the screen looks like java code
xml layout code for the "ZoomView" if any more clarification needed let me know. |
@micheltabib you try this code private void loadUserProfileView(){
PullToZoomScrollViewEx scrollView = (PullToZoomScrollViewEx) findViewById(R.id.user_profile_scroll_view);
View headView = LayoutInflater.from(this).inflate(R.layout.user_profile_header_view, null, false);
View zoomView = LayoutInflater.from(this).inflate(R.layout.user_profile_zoom_view, null, false);
View contentView = LayoutInflater.from(this).inflate(R.layout.user_profile_content_view, null, true);
scrollView.setHeaderView(headView);
scrollView.setZoomView(zoomView);
scrollView.setScrollContentView(contentView);
scrollView.setParallax(true);
DisplayMetrics localDisplayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics);
int mScreenHeight = localDisplayMetrics.heightPixels;
int mScreenWidth = localDisplayMetrics.widthPixels;
LinearLayout.LayoutParams localObject = new LinearLayout.LayoutParams(mScreenWidth, (int) (9.0F * (mScreenWidth / 16.0F)));
scrollView.setHeaderLayoutParams(localObject);
//This add code
ViewGroup.LayoutParams params = zoomView.getLayoutParams();
params.width = mScreenWidth;
params.height = (int) (9.0F * (mScreenWidth / 16.0F));
zoomView.setLayoutParams(params);
} |
@micheltabib can works? |
@Frank-Zhu thank you for your reply, but this solution didn't work. hope i was clear enough in my explanation. |
hi Frank-Zhu On Mon, Jun 8, 2015 at 1:10 PM, 祝文武 [email protected] wrote:
Michel Tabib |
@micheltabib Give me your layout view code.I will try reproduction problems. |
hi Br, On Wed, Jun 10, 2015 at 8:28 AM, 祝文武 [email protected] wrote:
Michel Tabib |
@micheltabib I am not reproduction this problems.This my code. private void loadViewForCode() {
PullToZoomScrollViewEx scrollView = (PullToZoomScrollViewEx) findViewById(R.id.scroll_view);
View headView = LayoutInflater.from(this).inflate(R.layout.user_profile_header_view, null, false);
ImageView zoomView = (ImageView) LayoutInflater.from(this).inflate(R.layout.profile_zoom_view, null, false);
View contentView = LayoutInflater.from(this).inflate(R.layout.user_profile_content_view, null, false);
scrollView.setHeaderView(headView);
scrollView.setZoomView(zoomView);
scrollView.setScrollContentView(contentView);
scrollView.setParallax(true);
Picasso.with(this).load("http://pica.nipic.com/2007-11-13/2007111317599808_2.jpg").into(zoomView);
DisplayMetrics localDisplayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics);
int mScreenHeight = localDisplayMetrics.heightPixels;
int mScreenWidth = localDisplayMetrics.widthPixels;
LinearLayout.LayoutParams localObject = new LinearLayout.LayoutParams(mScreenWidth, (int) (9.0F * (mScreenWidth / 16.0F)));
scrollView.setHeaderLayoutParams(localObject);
} user_profile_header_view.xml <?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:gravity="bottom">
<ImageView
android:id="@+id/iv_user_head"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_margin="30dp"
android:contentDescription="@string/app_name"
android:src="@drawable/ic_img_user_default"/>
</FrameLayout> profile_zoom_view.xml <?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/iv_zoom"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/ic_img_profile_bg"
android:scaleType="centerCrop"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/app_name" /> user_profile_content_view.xml <?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#cccccc"
android:orientation="vertical">
<TextView
android:id="@+id/tv_test1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="20dp"
android:text="test1"
android:textSize="20sp"/>
<TextView
android:id="@+id/tv_test2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="20dp"
android:text="test2"
android:textSize="20sp"/>
<TextView
android:id="@+id/tv_test3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="20dp"
android:text="test3"
android:textSize="20sp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="20dp"
android:text="test4"
android:textSize="20sp"/>
</LinearLayout> |
the library works fine for me, but i am using imageLoaderUniversal to load images for the zoomView and headerView. when the images are loaded, the contentView gets over the zoomView , not under it.
when no images are loaded, the views work fine
thanks for any tip.
br,
The text was updated successfully, but these errors were encountered: