android-scrollview

Use scrollView between two Linear Layout inside a LinearLayout

一世执手 提交于 2020-01-26 00:28:28
问题 i want to put two scroll view on two layouts that are in inside a main layout .Here is my XML file Please help me on this <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/flightResultData" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="8dp" android:gravity="center_horizontal" android:orientation="horizontal" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"

How do you add a ConstraintLayout to a LinearLayout in a ScrollView that fits the whole screen?

旧巷老猫 提交于 2020-01-25 10:20:09
问题 I want to be able to scroll through a LinearLayout, where each element is a ConstraintLayout that fits the whole screen. I've tried multiple values for layout_height in each Layout but nothing seems to be working. I could hardcode in a layout_height that fits my screen but that is not ideal. Here's what I currently have: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools=

List View Scroll Not Smooth

扶醉桌前 提交于 2020-01-21 11:48:21
问题 i have a custom list view, which displays users, and there photos i retrieve the data from API, Which gives JSON Output, My Issue is that the list view is not scrolling smoothly, it hangs for a sec and scrolls, it repeats the same till we reach the end. i thought it might me because i am running network related operation on the UI thread, but it continues to do that even after it completes loading? the structure of my custom Listview is <TextView style="@style/photo_post_text" android:id="@

How to set a max height of a any kind of view?

泄露秘密 提交于 2020-01-16 19:18:53
问题 Background I'm trying to put a view within a container view, so that the container will allow the view to have any height (and/or width,depending on your specification) , yet not pass a specific one. The problem There is no way to define "maxHeight" for any kind of view. You can only use exact size , use some tricks to take the spare size (layout_weight) or make the scrollView take as much space as it needs. The only similar thing is for EditText , which you can use "maxLines" together with

Scroll text in a horizontal scroll view

末鹿安然 提交于 2020-01-14 03:56:07
问题 I have seen a few posts similar to my issue. However, the solutions mentioned in those posts did not help me fix the problem. Here is the scenario. I have a TextView in a horizontal scroll view. The idea is as soon as a text (larger than the view) is appended to the TextView, it must be automatically scrolled to end. Here is the layout snippet. <HorizontalScrollView android:id="@+id/horizontalScrollView1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout

Insert 3 images dynamically to horizontal scrollview or Viewpager

我怕爱的太早我们不能终老 提交于 2020-01-13 05:35:19
问题 There is an image shown below for what I am looking for. Currently I am using view pager & circle indicator. In view page it is showing only a single image. I want in one viewpager three images as shown in pic. When I slide that page, again three different images loaded form server with text below. How to do this? Any idea regarding this or any other way to achieve this? My code is shown below. I add some xml layout here: homespizzaview.xml <LinearLayout android:id="@+id/linearLayoutbutton"

ViewPager inside ScrollView - vertical scroll doesn't work

谁都会走 提交于 2020-01-10 08:53:14
问题 So, I have this ScrollView with one child - a LinearLayout that has two children: a TextView and a ViewPager . ViewPager contains layout with many elements, that's why i need the ability to scroll vertically. Only pages in ViewPager may be scrolled horizontally (that is: I'd like to swipe horizontally only within the ViewPager ). That one TextView must not scroll horizontally but should scroll together with my ViewPager . Simple? No. I've seen extremely similar issues at StackOverflow popping

Make a scrollView autoscroll with drag and drop in Android

六眼飞鱼酱① 提交于 2020-01-10 02:05:24
问题 I searched all over, but could not find a solution. I have a view (lets call it myView) inside a scrollview. myView is bigger than the screen. Since I'm able to get the relative x,y position of my finger inside myView, I would like to make the scrollView autoscroll to the top/bottom when my finger enters a certain top/bottom threshold. I have some ideas, namely translating the drag location to the screen position but this did not solve this problem. thanks in advance cheers 回答1: All right I

ScrollView not scrolling at all

时间秒杀一切 提交于 2020-01-09 03:43:17
问题 I can't make a ScrollView properly scrolling. It always cut off the content on the bottom, as if it were a normal LinearLayout. My code <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" > <LinearLayout android:id="@+id/scroll_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:isScrollContainer="true" android:orientation="vertical" > Of

Can I scroll a ScrollView programmatically in Android?

£可爱£侵袭症+ 提交于 2020-01-08 12:01:33
问题 Is there any way to scroll a ScrollView programmatically to a certain position? I have created dynamic TableLayout which is placed in a ScrollView . So I want that on a specific action (like clicking a Button, etc.) the particular row should scroll automatically to a top position. Is it possible? 回答1: ScrollView sv = (ScrollView)findViewById(R.id.scrl); sv.scrollTo(0, sv.getBottom()); or sv.scrollTo(5, 10); 回答2: The answer from Pragna does not work always, try this: mScrollView.post(new