AppWidget TextView no multiple lines ?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

AppWidget TextView no multiple lines ?

Postby IHeartAndroid » Thu Jul 23, 2009 8:14 am

Hello,

I wonder why my TextView in my AppWidget won't split a long text into several lines.
Can anyone pls say what I did wrong ?

content.xml
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <?xml version="1.0" encoding="utf-8"?>
  3.  
  4. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  5.  
  6.    android:id="@+id/content"
  7.  
  8.    android:layout_width="fill_parent"
  9.  
  10.    android:layout_height="wrap_content"
  11.  
  12.    android:focusable="true"
  13.  
  14.    android:background="@drawable/mybackground">
  15.  
  16.    
  17.  
  18.     <TextView
  19.  
  20.        android:id="@+id/content_1"
  21.  
  22.        android:layout_width="wrap_content"
  23.  
  24.        android:layout_height="wrap_content"
  25.  
  26.        android:includeFontPadding="false"
  27.  
  28.        android:ellipsize="end"
  29.  
  30.        android:textSize="10sp"
  31.  
  32.        android:textStyle="bold"        
  33.  
  34.        android:layout_marginTop="10px"
  35.  
  36.        android:layout_marginLeft="10px"
  37.  
  38.        android:textColor="@android:color/black"
  39.  
  40.        />
  41.  
  42.        
  43.  
  44.        
  45.  
  46.         <TextView
  47.  
  48.        android:id="@+id/content_2"
  49.  
  50.        android:layout_width="wrap_content"
  51.  
  52.        android:layout_height="wrap_content"
  53.  
  54.        android:includeFontPadding="false"
  55.  
  56.        android:layout_below="@id/content_1"
  57.  
  58.        android:ellipsize="end"
  59.  
  60.        android:textSize="10sp"
  61.  
  62.        android:textStyle="bold"        
  63.  
  64.        android:layout_marginTop="10px"
  65.  
  66.        android:layout_marginLeft="10px"
  67.  
  68.        android:textColor="@android:color/black"
  69.  
  70.        />
  71.  
  72.        
  73.  
  74. </RelativeLayout>
  75.  
  76.  
Parsed in 0.004 seconds, using GeSHi 1.0.8.4




Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. public RemoteViews buildUpdate(Context context) {
  3.  
  4.                 // Build an update that holds the updated widget contents
  5.  
  6.                 RemoteViews updateViews = null;
  7.  
  8.             updateViews = new RemoteViews(context.getPackageName(), R.layout.content);
  9.  
  10.        
  11.  
  12.                
  13.  
  14.                
  15.  
  16.                
  17.  
  18.                
  19.  
  20.             updateViews.setTextViewText(R.id.content_1, "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ");
  21.  
  22.             updateViews.setTextViewText(R.id.content_2, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
  23.  
  24.            
  25.  
  26.            
  27.  
  28.        
  29.  
  30.            
  31.  
  32.             return updateViews;  
  33.  
  34.         }
  35.  
  36.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
User avatar
IHeartAndroid
Junior Developer
Junior Developer
 
Posts: 24
Joined: Wed Jul 08, 2009 8:51 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 6 guests