Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Saturday, April 30, 2016

Text Not Getting Displayed In Scrollview

Text Not Getting Displayed In Scrollview


I have a scrollview and a text view in it. I want to display the text in the textview scrollable.

XML FILE

                                      

APPLE.java CLASS

package com.example.fruitsinfo;    import android.app.Activity;  import android.os.Bundle;  import android.util.Log;  import android.widget.ImageView;  import android.widget.ScrollView;  import android.widget.TextView;    public class apple  extends Activity{      ImageView apple;      ScrollView sv;      TextView tv;      @Override        protected void onCreate(Bundle savedInstanceState) {          // TODO Auto-generated method stub          super.onCreate(savedInstanceState);          setContentView(R.layout.apple);          apple=(ImageView) findViewById(R.id.imageView1);          Log.d("asfdasf","apple class");          sv=(ScrollView) findViewById(R.id.SonucScrollView);          tv=(TextView) findViewById(R.id.SonucTextView);        }    }  

I have a scrollview and a text view in it. I want to display the text in the textview scrollable.

Answer by GrIsHu for Text Not Getting Displayed In Scrollview


Try to put your TextView inside ScrollView. You have not kept it inside Scrollview it seems in your code.

The Scrollview will always need to have sub child as any Layout. So you have to put some layout as a subchild of ScrollView and in that layout you can keep your TextView.

Try out as below:

                                                                    

Answer by Lokesh for Text Not Getting Displayed In Scrollview


Put your TextView inside ScrollView in XML like:

                    
to maintain high fruit quality, tree health, and high yields. A trend in orchard management is the use of organic methods. These ban the use of some pesticides, though some older pesticides are allowed. Organic methods include, for instance, introducing its natural predator to reduce the population of a particular pest. A wide range of pests and diseases can affect the plant; three of the more common diseases/pests are mildew, aphids and apple scab. Mildew: which is characterized by light grey powdery patches appearing on the leaves, shoots and flowers, normally in spring. The flowers will turn a creamy yellow color and will not develop correctly. This can be treated in a manner not dissimilar from treating Botrytis; eliminating the conditions which caused the disease in the first place and burning the infected plants are among the recommended actions to take.[54] Aphids: There are five species of aphids commonly found on apples: apple grain aphid, rosy apple aphid, apple aphid, spirea aphid and the woolly apple aphid. The aphid species can be identified by their color, the time of year when they are present and by differences in the cornicles, which are small paired projections from the rear of aphids.[54] Aphids feed on foliage using needle-like mouth parts to suck out plant juices. When present in high numbers, certain species reduce tree growth and vigor.[55] Apple scab: Apple scab causes leaves to develop olive-brown spots with a velvety texture that later turn brown and become cork-like in texture. The disease also affects the fruit, which also develops similar brown spots with velvety or cork-like textures. Apple scab is spread through fungus growing in old apple leaves on the ground and spreads during warm spring weather to infect the new year's growth.[56] Among the most serious disease problems are fireblight, a bacterial disease; and Gymnosporangium rust, and black spot, two fungal diseases.[55] Codling moths and apple maggots are two other pests which affect apple trees. Young apple trees are also prone to mammal pests like mice and deer, which feed on the soft bark of the trees, especially in winter.[56]" android:textappearance="?android:attr/textAppearanceMedium">

Answer by Android for Text Not Getting Displayed In Scrollview


The Scrollview will always need to have sub child as any Layout.thats why you need...

                                                                                                         

Add this 2 line to textview

android:maxLines="10"              android:scrollbars="vertical"  

And into java file

tv_desc = (TextView) findViewById(R.id.YOURTEXTID);      scrollView1.setOnTouchListener(new OnTouchListener() {                  @Override                  public boolean onTouch(View arg0, MotionEvent arg1) {                      // TODO Auto-generated method stub Log.v("PARENT",                      // "PARENT TOUCH");                        findViewById(R.id.tv_desc).getParent()                              .requestDisallowInterceptTouchEvent(false);          return false;                  }              });        tv_desc.setMovementMethod(new ScrollingMovementMethod());             tv_desc.setOnTouchListener(new OnTouchListener() {                    @Override                  public boolean onTouch(View arg0, MotionEvent arg1) {                        arg0.getParent().requestDisallowInterceptTouchEvent(true);                      return false;                  }              });  

Answer by Sethu for Text Not Getting Displayed In Scrollview


    try this one..      In your Layout of XML file try to put scrollview inside of the Textview..          use Linear Layout in this place.                    

Answer by M-sAnNan for Text Not Getting Displayed In Scrollview


just write your

TextView

inside

ScrollView

tag

          


Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72

Related Posts:

0 comments:

Post a Comment

Popular Posts

Fun Page

Powered by Blogger.