| HorizontalScrollView() | ใช้สร้าง Object HorizontalScrollView |
|---|---|
| addView() | ใช้เพิ่ม Object View เข้าไปใน Object HorizontalScrollView ณ ตำแหน่งที่กำหนด |
| addView ( child, params ) | ใช้เพิ่ม Object View เข้าไปใน Object HorizontalScrollView |
| addView ( child, index, params ) | ใช้เพิ่ม Object View เข้าไปใน Object HorizontalScrollView ณ ตำแหน่งที่กำหนด |
| addView() | ใช้เพิ่ม Object View เข้าไปใน Object HorizontalScrollView |
| getMaxScrollAmount() | ใช้คืนค่า จำนวนของ scroll ทั้งหมด ของ Object HorizontalScrollView |
| isSmoothScrollingEnabled() | ใช้ตรวจสอบว่า มีการอนุณาติให้ใช้ smooth scroll หรือไม่ |
| scrollTo() | ใช้กำหนดให้ scrollbar เลื่อนไปยังตำแหน่งที่กำหนด |
| setSmoothScrollingEnabled() | ใช้กำหนดว่า อนุญาติ ให้ใช้ smooth scroll หรือไม่ |
| smoothScrollBy() | ใช้กำหนดให้ เลื่อน scroll ไปตามจำนวนที่กำหนด |
| smoothScrollTo() | ใช้กำหนดให้ scrollbar เลื่อนไปยังตำแหน่งที่กำหนด |
| onSizeChanged() | เป็น method ที่ใช้สำหรับการ overridde โดย method นี้จะถูกเรียกใช้เมื่อ Object HorizontalScrollView ถูกเปลี่ยนแปลง ขนาด |
method:HorizontalScrollView ( Context context )
return type:HorizontalScrollView
content:ใช้สร้าง Object HorizontalScrollView
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); HorizontalScrollView scroll_view = new HorizontalScrollView ( this ); setContentView( scroll_view ); } }
method:addView ( View child, int index )
return type:void
content:ใช้เพิ่ม Object View เข้าไปใน Object HorizontalScrollView ณ ตำแหน่งที่กำหนด
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); HorizontalScrollView scroll_view = new HorizontalScrollView ( this ); Button button = new Button ( this ); button.setText( "InTo BambooLabCode" ); scroll_view.addView ( button, 0 ); setContentView( scroll_view ); } }
method:addView ( View child, ViewGroup.LayoutParams params )
return type:void
content:ใช้เพิ่ม Object View เข้าไปใน Object HorizontalScrollView
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); HorizontalScrollView scroll_view = new HorizontalScrollView ( this ); Button button = new Button ( this ); button.setText( "InTo BambooLabCode" ); ViewGroup.LayoutParams params = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT ); scroll_view.addView ( button, params ); setContentView( scroll_view ); } }
method:addView ( View child, int index, ViewGroup.LayoutParams params )
return type:void
content:ใช้เพิ่ม Object View เข้าไปใน Object HorizontalScrollView ณ ตำแหน่งที่กำหนด
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); HorizontalScrollView scroll_view = new HorizontalScrollView ( this ); Button button = new Button ( this ); button.setText( "InTo BambooLabCode" ); ViewGroup.LayoutParams params = new ViewGroup.LayoutParams( 100, 150 ); scroll_view.addView ( button, 2, params ); setContentView( scroll_view ); } }
method:addView ( View child )
return type:void
content:ใช้เพิ่ม Object View เข้าไปใน Object HorizontalScrollView
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); HorizontalScrollView scroll_view = new HorizontalScrollView ( this ); Button button = new Button ( this ); button.setText ( "InTo BambooLabCode" ); scroll_view.addView ( button ); setContentView( scroll_view ); } }
method:getMaxScrollAmount ( )
return type:int
content:ใช้คืนค่า จำนวนของ scroll ทั้งหมด ของ Object HorizontalScrollView
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); HorizontalScrollView scroll_view = new HorizontalScrollView ( this ); Button button = new Button ( this ); button.setText ( "InTo BambooLabCode" ); scroll_view.addView ( button ); int max_scroll = scroll_view.getMaxScrollAmount ( ); setContentView( scroll_view ); } }
method:isSmoothScrollingEnabled ( )
return type:boolean
content:ใช้ตรวจสอบว่า มีการอนุณาติให้ใช้ smooth scroll หรือไม่
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); HorizontalScrollView scroll_view = new HorizontalScrollView ( this ); Button button = new Button ( this ); button.setText ( "InTo BambooLabCode" ); scroll_view.addView ( button ); if ( scroll_view.isSmoothScrollingEnabled ( ) ) { Toast.makeText ( this, "HorizontalScrollView is enabled smoothscroll", Toast.LENGTH_SHORT ).show ( ); } setContentView( scroll_view ); } }
method:scrollTo ( int x, int y )
return type:void
content:ใช้กำหนดให้ scrollbar เลื่อนไปยังตำแหน่งที่กำหนด
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); HorizontalScrollView scroll_view = new HorizontalScrollView ( this ); Button button = new Button ( this ); button.setText ( "InTo BambooLabCode" ); scroll_view.addView ( button ); scroll_view.scrollTo ( 0, 0 ); setContentView( scroll_view ); } }
method:setSmoothScrollingEnabled ( boolean smoothScrollingEnabled )
return type:void
content:ใช้กำหนดว่า อนุญาติ ให้ใช้ smooth scroll หรือไม่
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); HorizontalScrollView scroll_view = new HorizontalScrollView ( this ); Button button = new Button ( this ); button.setText ( "InTo BambooLabCode" ); scroll_view.addView ( button ); scroll_view.setSmoothScrollingEnabled ( false ); setContentView( scroll_view ); } }
method:smoothScrollBy ( int dx, int dy )
return type:void
content:ใช้กำหนดให้ เลื่อน scroll ไปตามจำนวนที่กำหนด
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); HorizontalScrollView scroll_view = new HorizontalScrollView ( this ); Button button = new Button ( this ); button.setText ( "InTo BambooLabCode" ); scroll_view.addView ( button ); scroll_view.smoothScrollBy ( 10, 10 ); setContentView( scroll_view ); } }
method:smoothScrollTo ( int x, int y )
return type:void
content:ใช้กำหนดให้ scrollbar เลื่อนไปยังตำแหน่งที่กำหนด
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); HorizontalScrollView scroll_view = new HorizontalScrollView ( this ); Button button = new Button ( this ); button.setText ( "InTo BambooLabCode" ); scroll_view.addView ( button ); scroll_view.smoothScrollTo ( 0, 0 ); setContentView( scroll_view ); } }
method:onSizeChanged ( int w, int h, int oldw, int oldh )
return type:void
content:เป็น method ที่ใช้สำหรับการ overridde โดย method นี้จะถูกเรียกใช้เมื่อ Object HorizontalScrollView ถูกเปลี่ยนแปลง ขนาด
example:public class BambooView extends HorizontalScrollView { protected void onSizeChanged ( int w, int h, int oldw, int oldh ) { } }