in my project i use sliding_Image and marquee text....but the text don't move or sometimes it move and when the image of page changes the text be refreshed... this is my code:
aBuffer="";
File myFile = new File("/mnt/sdcard/CS/T.txt");
FileInputStream fIn = null;
try {
fIn = new FileInputStream(myFile);
} catch (FileNotFoundException e1) {
e1.printStackTrace();
}
BufferedReader myReader = new BufferedReader(new InputStreamReader(fIn));
try {
while ((aDataRow = myReader.readLine()) != null) {
aBuffer += aDataRow + "\n";
}
Log.d("tag","is : "+aBuffer);
myReader.close();
} catch (IOException e) {
e.printStackTrace();
}
txv=(TextView)findViewById(R.id.textView1);
txv.setText(aBuffer);
txv.setSelected(true);
txv.setEllipsize(TruncateAt.MARQUEE);
txv.setSingleLine(true);
and this is xml of myActivity :
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:lines="1"
android:singleLine="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:textColor="#ff4500" />
0 comments:
Post a Comment