这是我的onCreate:
@OverrIDe public voID onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentVIEw(R.layout.main); vIEwFlipper = (VIEwFlipper)findVIEwByID(R.ID.flipper); vIEwFlipper.setAnimation(AnimationUtils.loadAnimation(this,R.anim.push_left_in)); mapVIEw = (MapVIEw)findVIEwByID(R.ID.mapVIEw); mapVIEw.setBuiltInZoomControls(true); }
push_left_in来自Google示例.这是触发动作:
@OverrIDe public boolean onoptionsItemSelected(MenuItem item) { // Handle item selection switch (item.getItemID()) { case R.ID.button_map: vIEwFlipper.setdisplayedChild(0); return true; case R.ID.button_conditions_general: vIEwFlipper.setdisplayedChild(1); return true;(etc)
我的布局:
<?xml version="1.0" enCoding="utf-8"?><linearLayout androID:ID="@+ID/mainlayout" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent" xmlns:androID="http://schemas.androID.com/apk/res/androID"> <VIEwFlipper androID:ID="@+ID/flipper" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent"> <vIEw androID:ID="@+ID/mapVIEw" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent" androID:clickable="true" androID:APIKey="MY_API_KEY" /> <tableLayout androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent" androID:background="#ffffff" androID:stretchColumns="1" > <tableRow> <TextVIEw androID:ID="@+ID/fIEld1" androID:layout_column="1" androID:layout_wIDth="fill_parent" androID:layout_height="wrap_content" androID:textcolor="#000000" androID:textStyle="bold" androID:textSize="18px" androID:text="@string/fIEld1" > </TextVIEw> <EditText androID:text="100" androID:ID="@+ID/fIEld2" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content"> </EditText> <TextVIEw androID:ID="@+ID/fIEld3" androID:layout_wIDth="fill_parent" androID:layout_height="wrap_content" androID:textcolor="#000000" androID:textStyle="bold" androID:textSize="18px" androID:text="%" > </TextVIEw> </tableRow> </tableLayout> </VIEwFlipper></linearLayout>
思考?
解决方法 请尝试在xml文件中设置动画.<VIEwFlipper androID:ID="@+ID/flipper" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent" androID:inAnimation="@anim/push_left_in">总结
以上是内存溢出为你收集整理的android – ViewFlipper没有动画?全部内容,希望文章能够帮你解决android – ViewFlipper没有动画?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)