Copy Code code as follows:
<framelayout
Android:layout_width= "Fill_parent"
android:layout_height= "Wrap_content"
Android:background= "#fff"
Android:paddingbottom= "5DP"
android:paddingleft= "5DP"
android:paddingright= "2DP"
>
<imageview
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_gravity= "Right"
android:src= "@drawable/up_icon"
android:layout_margintop= "0DP"
android:paddingtop= "0DP"/>
<linearlayout
android:layout_width= "240dip"
Android:layout_ height= "Wrap_content"
android:layout_marginleft= "5DP"
android:layout_marginright= "7DP"
android:orientation= "Horizontal"
<textview
android:layout_width= "0DP"
android:layout_height= "Wrap_content"
Android:layout_ weight= "1"
android:gravity= "left"
android:text= "excellent"
android:textsize= "12SP"/>
<textview
android:layout_width= "0DP"
android:layout_height= "Wrap_content"
Android:layout_ weight= "1"
android:gravity= "left"
android:text= "Liang"
android:textsize= "12SP"/>
<textview
android:layout_width= "0DP"
android:layout_height= "Wrap_content"
Android:layout_ weight= "1"
android:gravity= "left"
android:text= "Medium"
android:textsize= "12SP"/>
<textview
android:layout_width= "0DP"
android:layout_height= "Wrap_content"
Android:layout_ weight= "1"
android:gravity= "left"
android:text= "unhealthy"
android:textsize= "12SP"/>
<textview
Android:layout_width= "0DP"
android:layout_height= "Wrap_content"
android:layout_weight= "1"
Android:gravity= "left"
Android:text= is "poisoned."
Android:textsize= "12SP"/>
</LinearLayout>
<linearlayout
Android:layout_width= "240dip"
android:layout_height= "Wrap_content"
android:layout_marginleft= "5DP"
android:layout_marginright= "7DP"
android:layout_margintop= "40DP"
android:orientation= "Horizontal" >
<textview
android:layout_width= "0DP"
android:layout_height= "Wrap_content"
Android:layout_ weight= "1"
android:gravity= "Center_horizontal"
"android:text="
android: Textsize= "12SP"/>
<textview
android:layout_width= "0DP"
android:layout_height= "Wrap_content"
Android:layout_ weight= "1"
android:gravity= "Center_horizontal"
"android:text="
android: Textsize= "12SP"/>
<textview
android:layout_width= "0DP"
android:layout_height= "Wrap_content"
Android:layout_ weight= "1"
android:gravity= "Center_horizontal"
android:text= "160"
android: Textsize= "12SP"/>
<textview
android:layout_width= "0DP"
android:layout_height= "Wrap_content"
Android:layout_ weight= "1"
android:gravity= "Center_horizontal"
android:text=
android: Textsize= "12SP"/>
<textview
Android:layout_width= "0DP"
android:layout_height= "Wrap_content"
android:layout_weight= "1"
Android:gravity= "Center_horizontal"
Android:text= "400"
Android:textsize= "12SP"/>
</LinearLayout>
<imageview
android:layout_width= "Wrap_content"
Android:layout_ height= "Wrap_content"
android:layout_marginleft= "10DP"
android:layout_margintop= "10DP"
android:src= "@drawable/zhizhen"
android:id= "@+id/zhizhen"/>
<imageview
Android:id= "@+id/dengji_img"
Android:layout_width= "250dip"
android:layout_height= "Wrap_content"
android:layout_margintop= "25DP"
android:src= "@drawable/dengji_icon"/>
</FrameLayout>
The above code implements the layout of the
First, because the pointer has the following scroll bar, so this is a framelayout layout. Second, to achieve a constant speed of the pointer scrolling, you need to open a thread, the thread can realize the use of loops, as well as the threads of hibernation, through the control of the icon on the Padding property to achieve scrolling animation effect
Copy Code code as follows:
Handler MyHandler =new Handler () {
@Override
public void Handlemessage (msg) {
TODO auto-generated Method Stub
Super.handlemessage (msg);
The changes and loops for C should be run in threads, or run only once,
Zhizhen.setpadding (c, 0, 0, 0);
}
};
Class Mythread extends thread{
@Override
public void Run () {
Sends a message informing the main thread to change the UI
try {
while (C<=input) {
c=c+1;
This.sleep (10);
Myhandler.sendemptymessage (0);
}
catch (Interruptedexception e) {
TODO auto-generated Catch block
E.printstacktrace ();
}