android - Make HorizontalScrollView hover ViewPager/Fragments -
Can I hover my horizontal view (sliding tablay) instead of displaying my ViewPager and its pieces linearly ? The framelayout and the relative layout have already been tried, and it does not work. Swipe stops working after this chang. Apart from this, their margin hat has been changed, but the viewpages are always at the top of the scroll-view. The idea here is to hide the horizontal slab tab, when users scroll through a list in a view paper piece. Thanks I found a workaround for this: The first thing to call this is that you want to be on the front of others BrinToFront () method: Then you can see the scene wherever you want, if you want to keep it on top, but only after the action bar, you can do the following: & lt; LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http://schemas.android.com/tools" Android: Layout_width = "match_parent" Android: layout_height = "Match_parent" Android: orientation = "vertical" tool: reference = "com.zerohora.app.fragments.ContentFragment" & gt; & Lt; com.zerohora.app.widgets.SlidingTabLayoutAndroid: id = "@ + id / sliding_tabs" Android: layout_width = "match_parent" android: layout_height = "wrap_content" /> & Lt; Android: layout_height = "0px" Android: layout_weight = "1" Android: layout_gravity = "top" / android: Gt; & Lt; / LinearLayout & gt;
mSlidingTabLayout = (SlidingTabLayout) view.findViewById (R.id.sliding_tabs); MSlidingTabLayout.bringToFront ();
// viewport's hegath window manager wm = (WindowManager) getActivity (). GetSystemService (Reference WINDOW_SERVICE); Display display = wm.getDefaultDisplay (); Point size = new point (); Display.getSize (size); Int viewportHeight = size.y; // Type the height of the ActionBar Value TV = New typed value (); Int ActionHaright = 0; If (getActivity (get) GetTheme () resolveAttribute (android.R.attr.actionBarSize, TV, true)) {actionBarHeight = TypedValue.complexToDimensionPixelSize (.ttv.data, getResources () getDisplayMetrics ()); } // Get the height of the status bar int Position BarHeight = 0; Int resourceId = getResources (). GetIdentifier ("status_bar_height", "dimen", "android"); If (sourceId> gt; 0) {statusBarHeight = getResources (). GetDimensionPixelSize (resourceId); } // set tab position LinearLayout.LayoutParams parameter = new LinearLayout.LayoutParams (RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT); Params.topMargin = - (ViewportHight) + ActionBaright + Statsbar Highlight; MSlidingTabLayout.setLayoutParams (parameter); // Radra Display mSlidingTabLayout.invalidate (); MViewPager.invalidate ();
Comments
Post a Comment