Note that there are some explanatory texts on larger screens.

plurals
  1. POTextview within GridView very difficult to scroll
    primarykey
    data
    text
    <p>GridView code:</p> <pre><code>&lt;GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/activity_graph" android:verticalSpacing="0dip" android:horizontalSpacing="5dip" android:stretchMode="columnWidth" android:gravity="center" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#0000FF"&gt; &lt;/GridView&gt; </code></pre> <p>GridItem code:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/GridItem" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:gravity="center_horizontal" android:paddingTop="20px" android:paddingBottom="20px" android:background="#00FF00"&gt; &lt;TextView android:id="@+id/grid_item_vote_count" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal" android:layout_centerHorizontal="true"&gt; &lt;/TextView&gt; &lt;RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:background="#ABABAB"&gt; &lt;TextView android:id="@+id/grid_item_answer" android:layout_alignParentBottom="true" android:layout_width="match_parent" android:layout_height="150dp" android:gravity="center_horizontal" android:layout_centerHorizontal="true" android:focusable="true" android:focusableInTouchMode="true" android:fadeScrollbars="false" android:scrollbars="vertical" &gt; &lt;/TextView&gt; &lt;ImageView android:id="@+id/grid_item_bar" android:layout_width="20px" android:layout_above="@id/grid_item_answer" android:layout_height="wrap_content" android:layout_centerHorizontal="true" &gt; &lt;/ImageView&gt; &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>Adapter:</p> <pre><code> @Override public View getView(int position, View convertView, ViewGroup parent) { View myView = null; float height = parent.getHeight(); if(convertView==null) { LayoutInflater li = (LayoutInflater) parent.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); myView = li.inflate(R.layout.grid_item, null); }else{ myView = convertView; } myView.setMinimumHeight((int)height); int numVotes = -1; String answer = answerText[position]; switch(position) { case 0: numVotes = answerCount1; break; case 1: numVotes = answerCount2; break; case 2: numVotes = answerCount3; break; case 3: numVotes = answerCount4; break; default: Log.d("JK", "Getting view for too high position"); } TextView tv = (TextView) myView.findViewById(R.id.grid_item_vote_count); tv.setText(Integer.toString(numVotes)); tv.setTextColor(Color.BLACK); int barHeight = (int) (0.7f * height * ((float) numVotes / maxVotes)); ImageView imageView =(ImageView) myView.findViewById(R.id.grid_item_bar); imageView.setImageDrawable(new ColorDrawable(getColor(position))); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) imageView.getLayoutParams(); params.height = barHeight; imageView.setLayoutParams(params); //imageView.setLayoutParams(new RelativeLayout.LayoutParams(16, barHeight)); tv = (TextView) myView.findViewById(R.id.grid_item_answer); tv.setText(answer); tv.setTextColor(Color.BLACK); tv.setMovementMethod(ScrollingMovementMethod.getInstance()); return myView; } </code></pre> <p>With the above, I can see the vertical scrollbar in my answer textview, but it seems like I have to move my finger on a very specific portion of the textview in order to scroll it. After about a minute of swiping upwards on the textview, I might be able to scroll it once. Is there a fix for this or a way I can ensure the entire textview allows me to scroll on it? Thank you for your time.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload