The implementation result is as follows: (thanks to the explanation from the old Luo video) Video: click here
It's okay to look at different implementation schemes. Displays nested dot images in textview. Good results. Some people should say that you are so stupid and will use it for a while. Haha. In fact, this method can avoid confusion and nesting in the layout. You only need to create a textview and copy the image into the drawable folder to implement some functions. It does not need to be so troublesome. Otherwise, it would be difficult to embed a lot of la S.
The Code is as follows:
Package lixiaodaoaaa.com. ui; import Java. lang. reflect. field; import android. app. activity; import android. graphics. color; import android. graphics. drawable. drawable; import android. OS. bundle; import android. text. HTML; import android. text. HTML. imagegetter; import android. widget. textview;/*** by lixiaodaoaaa tecent_weibo: http://t.qq.com/lixiaodaoaaa * xinlang_weibo: http://weibo.com/lixiaodaoaaa ** @ author Lixiaodaoaaa **/public class mainactivity extends activity {/*** This method uses the resource name to compare the resource idleness to the face_01.png ID under the drawablefolder; * mainly uses R. drawable. class. getfield uses the reflection method. ** @ Param name * @ return */Public int gerresouceidbyname (string name) {try {field = R. drawable. class. getfield (name); Return integer. parseint (field. get (null ). tostring ();} catch (exception e) {system. out. println ("parse fialed return 0 is here");} return 0 ;}@ overridepublic void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); setcontentview (R. layout. activity_main); inittextvie W ();} private void inittextview () {textview = (textview) findviewbyid (R. id. TV _test01); textview. setbackgroundcolor (color. white); textview. settextcolor (color. black); textview. settextsize (20); string html1 = "Image 1 <p> "; html1 + = "Image 2 <p> "; html1 + = "Image 3 <p>"; // <p> here is the section mark. Let him display the text below the line break; html1 + = "Image 4 <a href = 'HTTP: // weibo.com/lixiaodaoaaa'> </a> <p> "; html1 + = "image 5
Source code: Click here to download