android – ViewFlipper没有动画?

android – ViewFlipper没有动画?,第1张

概述我正在尝试使用ViewFlipper在视图之间添加动画,如下面的主题教程.但是,它似乎并不想工作.它会改变页面,但我没有动画 – 即使我给push_left_in添加了很大的延迟. 这是我的onCreate: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedIns 我正在尝试使用VIEwFlipper在视图之间添加动画,如下面的主题教程.但是,它似乎并不想工作.它会改变页面,但我没有动画 – 即使我给push_left_in添加了很大的延迟.

这是我的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没有动画?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1138872.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-31
下一篇 2022-05-31

发表评论

登录后才能评论

评论列表(0条)

保存