into writing, software * Distributed under the License is distributed on a "as is" BASIS, * without Warranties or CONDITIONS of any KIND, either express OR implied. * See the License for the specific language governing permissions and * limitations under the License. */package Com.edaixi.tempbak;import Android.graphics.paint;import Android.graphics.radialgradient;import Android.graphics.drawable.shapedrawable;import android.graphics.drawable.shapes.shape;/** * A data structure that Holds a shap
.Bold fontIn the xml layout file, you can use android: textStyle = "bold" to set English to bold, but you cannot set Chinese to bold. The method to set Chinese to bold is: set setFakeBoldText to true using TextPaint in the form of "bold. The sample code is as follows:TV. getPaint (). setFakeBoldText (true );The effect is as follows:4.Add shadowYou can use a series of android: shadowXXX attributes in the xml layout file to add and set shadows. Specific
(builder. toString (). substring (0, builder. toString (). length ()-1 ));Builder. delete (0, builder. length ()-1 );Length = mPaint. measureText (text. substring (I, I + 1 ));I --;}}}// The following code uses the number of lines displayed above to draw the text on the canvas and update it in real time.@ OverridePublic void onDraw (Canvas canvas ){If (textList. size () = 0) return;For (int I = 0; I Canvas. drawText (textList. get (I), 0, this. getHeight () + (I + 1) * mPaint. getTextSize ()-st
intervalPostdelayed ( This, Circlespeed); } } /*** Get text display length*/ Private voidGettextwidth () {Paint Paint= This. Getpaint (); String Str= This. GetText (). toString (); LOG.I (TAG, str); if(str = =NULL) {TextWidth= 0; } textWidth= (int) Paint.measuretext (str); } /*** Set the number of scrolling times, the number of times after the setting is not visible *@paramCircletimes*/ Public voidSetcircletimes (intcircletimes
Android: Use strikethrough in TextViewCategory: Android2014-09-25 13:17 3431 People read comments (0) favorite reports Add strikethrough to TextView programmatically:[Java]View Plaincopy
Textview.getpaint (). SetFlags (Paint.strike_thru_text_flag);
By the way study:Textview.getpaint ():[Java]View Plaincopy
Returns the base paint used for the text.
Consult the Paint ' s properties and not to change them.
Public Textpaint get
displaymenuitemlist * /public void ShowMenu (list 3, Drawing factory class Paintfactory/** * author:created by Zzl on 16/1/8. */public class Paintfactory {public static Context ctxt; public static int fenbianlv[]= new INT[2]; public static double x_fraction; public static double y_fraction; public static Typeface Fontfacechalkboard; public static void Init () {ctxt = Mainapplication.getcontext (); FENBIANLV = Commonutils.getscreenwidthandheight (Mainapplicat
right of the text box after the following:1 Public voidrun () {2 if(!ismeasure) {//text width just need to get it once.3 gettextwidth (); 4Ismeasure =true;5 }6LOG.I ("Don't eat breakfast", "Run GetWidth:" + This. GetWidth () + "TextWidth:" +textWidth);7 8 if( This. GetWidth () textWidth) {9Currentscrollx + = 2;TenScrollTo (CURRENTSCROLLX, 0); One if(isstop) { ALOG.I ("Don't eat Breakfast", "isstop"); - return; - } the
, buffertype.spannable); TextWidth = Getpaint (). Measuretext (".",0,1);//One of the two is to add the Updatelistener to a point 1, through which the refresh actionObjectanimator dotonejumpanimator = Createdotjumpanimator (Dotone,0); Dotonejumpanimator.addupdatelistener (NewAnimatorupdatelistener () {@Override Public void onanimationupdate(Valueanimator valueanimator) {invalidate (); } });//Here control the combination of
the coordinate is in the upper left corner of the content *, the positive direction of the Y axis is vertical and upward, and the X axis is horizontal to the right. * This understanding is awaiting further verification. **/public class marqueetext extends textview implements runnable {private int contentwidth = 0; private int scrolltox = 0; private Boolean isstop = false; private Boolean isrun = true; private Boolean ismeasurecontentwidth = false; Public marqueetext (context cont EXT, attribute
font color
Chinese. setTextColor (Color.MAGENTA);
Chinese. setTextSize (20366f );
Chinese. setTypeface (Typeface.DEFAULT_BOLD, Typeface.BOLD);
// Set setFakeBoldText to true using the text in bold of TextPaint. Currently, the "italic-like" method cannot be used.
Tp = chinese. getPaint ();
Tp. setFakeBoldText (True);
LinearLayout. addView (chinese,NewLinearLayout. LayoutParams (LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
(7) create custom
I. Tips commonly used in PS. Use shadow and stroke to replace bold ones. Here we will learn from them, not original.
Android: FIG = "#000000"Android: shadowdx = "0.2" Android: shadowdy = "0.0" Android: shadowradius = "0.2"Convert from: http://www.eoeandroid.com/thread-75171-1-1.html、use android:textstyle##boldin the XML file. 3. You cannot set Chinese to bold. You can set Chinese to bold:
Textview TV = (textview) findviewbyid (R. Id. textview01 );Textpaint TP = TV.
In Android, TextView is added with strikethrough and androidtextview
Project requirements ~~~~
One of the prices of items in the mall is the preferential price... A strikethrough line is required.
Public class TestActivity extends Activity {private TextView TV; @ Overridepublic void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); setContentView (R. layout. activity_main); TV = (TextView) findViewById (R. id. tvId); TV. getPaint
App1 for group purchases using imitation handles -- home page, app1 for group purchases using handles --
Fragment_home.xml
Ii. home_head_page.xml
Banner two-page Bar icon hot movie three as one addHeaderView (headView) into RefreshListView
Three GoodsListAdapter:
mGoodsListAdapter = new GoodsListAdapter(getActivity(),mGoodlist,headerViewsCount);mRefreshListView.setAdapter(mGoodsListAdapter);
1. SimpleDraweeView
2. show images without reservation
Control whether to display in Adapter
if (m
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.