Whittled superscript sup tag TextView Android issue
Issue: Cropped superscript index between tags sup /sup is not correctly visible in TextView or View as Button.
String s = "10<sup>12 </sup>";
textView.setText(Html.fromHtml(s)); // 12 will cropped
// solution:
s = "10<sup>12 </sup>\t "; // add behind ending of sup tag the tabulator \t,
// but not char \t but only press to TAB key!!! in source code
textView.setText(Html.fromHtml(s)); // 12 is visible correctly
396LW NO topic_id
AD
Další témata ....(Topics)
MainActivity.java
res/layout/main.xml
res/drawable/my_progress.xml
ProgressBar mProgressBarScore;
// onCreate
mProgressBarScore = (ProgressBar)findViewById(R.id.progressBarScore);
Resources res = getResources();
mProgressBarScore.setProgressDrawable(res.getDrawable( R.drawable.my_progress));
res/layout/main.xml
<ProgressBar
android:id="@+id/progressBarScore"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:max="100"/>
res/drawable/my_progress.xml
-
android:startColor="#FF001A"
android:centerColor="#ff5a5d5a"
android:centerY="0.75"
android:endColor="#FF001A"
android:angle="270"
/>
-
android:startColor="#80ffd300"
android:centerColor="#80ffb600"
android:centerY="0.75"
android:endColor="#a0ffcb00"
android:angle="270"
/>
android:id="@android:id/progress"
>
android:radius="10dip" />
android:startColor="#00ff00"
android:centerColor="#80ffb600"
android:centerY="0.75"
android:endColor="#339900"
android:angle="270" />
Import a new Android project for example downloaded from internet via Eclipse into project folder.
- Right click into projects explorer in Eclipse and select Import
- Android
- Existing Android Code Into Workspace
- Root Directory (select folder of downloaded project)
- Check your downloaded project
- Check Copy project into Workspace
- Finish (press)
int nf = Math.round(5.789f);
System.out.print(nf); // 6
float f = 28.611f;
int n3 = Math.round(f);
System.out.println(n3); // 29
double d = 1234.56;
long lon = Math.round(d);
System.out.println(lon); // 1235
int diff = 90 - 40;
// float fDeleni = diff / 10; // error code
float fDeleni = (float)diff / 10.f; // ok
int nRound = Math.round(fDeleni);
// Caution:
int n2 = (int) 8.999f;
System.out.println(n2); // 8
How include layout defined in other xml file into another xml file example:
res/layout/my_layout.xml into
main.xml
res/layout/my_layout.xml into
main.xml
<include layout="@layout/my_layout" android:id="@+id/idMyLayout" />
If a button have focus, marquee will run.
Important:
android:singleLine="true"
android:ellipsize="marquee"
Optional:
android:marqueeRepeatLimit="1"
Important:
android:singleLine="true"
android:ellipsize="marquee"
Optional:
android:marqueeRepeatLimit="1"
// main.xml
<Button
android:layout_width="150dip"
android:layout_height="wrap_content"
android:text="My button with a long text for marquee as a example source code"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="1"/>
Editace: 2013-12-09 10:10:04
Počet článků v kategorii: 396
Url:whittled-superscript-sup-tag-textview-android-issue