小编Man*_*lka的帖子

用于在Android中启动活动的自定义动画无法按预期工作

我对Android有点新意.我需要在活动打开时在我的应用中自定义动画.

我在我的应用程序中使用了以下代码 styles.xml

<style name="YourAnimation.Activity" parent="@android:style/Animation.Activity">
    <item name="android:windowEnterAnimation">@anim/fade_in</item>
    <item name="android:windowExitAnimation">@anim/fade_out</item>
</style>
Run Code Online (Sandbox Code Playgroud)

然后将样式应用于同一文件中的主题.

<style name="YourTheme" parent="android:Theme.Translucent">
    <item name="android:windowAnimationStyle">@style/CustomAnimationActivity</item>
</style>
Run Code Online (Sandbox Code Playgroud)

然后在我的主题中添加主题 AndroidManifest.xml

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/YourTheme" >
</application>
Run Code Online (Sandbox Code Playgroud)

但是,当我运行它时,会发生以下错误.

错误

我想我需要在我的项目中的某处添加动画ml文件.但是,不知道该怎么做.有人请帮帮我.

提前致谢.:)

-编辑-

这里是 fade_in.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:fillAfter="true">
    <alpha
        android:duration="1000"
        android:fromAlpha="0.0"
        android:interpolator="@android:anim/accelerate_interpolator"
        android:toAlpha="1.0"/>
</set>
Run Code Online (Sandbox Code Playgroud)

这里是 fade_out.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:fillAfter="true">
    <alpha
        android:duration="1000"
        android:fromAlpha="1.0"
        android:interpolator="@android:anim/accelerate_interpolator"
        android:toAlpha="0.0"/>
</set>
Run Code Online (Sandbox Code Playgroud)

崩溃日志

05-20 15:36:47.216    3557-3557/com.myayubo E/AndroidRuntime? FATAL EXCEPTION: main
    Process: com.myayubo, PID: 3557
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myayubo/com.myayubo.PreSplash}: java.lang.IllegalStateException: You need …
Run Code Online (Sandbox Code Playgroud)

animation android

16
推荐指数
1
解决办法
919
查看次数

如何从Protractor测试Angular js日期选择器

我是Protractor的新手,在这里我试图从Protractor测试一个angularjs日期选择器.

我试图找到一种方法来做到这一点,这篇文章是我发现的唯一一件事并且使用起来不太清楚

如果有人知道如何测试请帮助.

我需要的是选择今天的日期.

提前致谢 :)

  • 编辑 -

alecxe,这是我的日期选择器的屏幕截图.遗憾的是无法提供页面的链接.:(

日期选择器

<input 
       class="form-control ng-pristine ng-valid ng-not-empty ng-touched" 
       ng-model="invoice.fromdate" 
       data-date-format="yyyy-MM-dd" 
       data-date-type="string" 
       data-max-="" data-autoclose="1" 
       bs-datepicker="" 
       ng-change="dateRange()" 
       type="text">
Run Code Online (Sandbox Code Playgroud)

datepicker protractor

4
推荐指数
1
解决办法
1万
查看次数

如何在oracle DB中检查某个日期是否在当前日历月中

我需要打印当前日历月作为注册月份的记录.

我用sysdate这个功能.但是,我不确定这是否正确.

我的代码是,

select * from student where sysdate,trunc('mm') = enrolled_month;
Run Code Online (Sandbox Code Playgroud)

我只需要一些方法来使用sysdate函数打印当前月份.

任何形式的帮助将不胜感激.

提前致谢.

sql oracle date

3
推荐指数
3
解决办法
120
查看次数

Android地图当应用程序加载在Fragment中不起作用时,缩放到当前位置

我正在尝试编写一个代码,当应用程序加载时,该代码具有Map Zooming到当前位置.

这是我用来缩放地图的代码.

  //Zoom to the current location
    public Location getMyLocation() {
        LocationManager locationManager = (LocationManager) getActivity().getSystemService(Context.LOCATION_SERVICE);
        Criteria criteria = new Criteria();

        Location location = locationManager.getLastKnownLocation(locationManager.getBestProvider(criteria, false));
        if (location != null)
        {
            map.animateCamera(CameraUpdateFactory.newLatLngZoom(
                    new LatLng(location.getLatitude(), location.getLongitude()), 13));

            CameraPosition cameraPosition = new CameraPosition.Builder()
                    .target(new LatLng(location.getLatitude(), location.getLongitude()))      // Sets the center of the map to location user
                    .zoom(17)                   // Sets the zoom
                    .bearing(90)                // Sets the orientation of the camera to east
                    .tilt(40)                   // Sets the tilt of the camera to 30 …
Run Code Online (Sandbox Code Playgroud)

android google-maps android-fragments

1
推荐指数
1
解决办法
341
查看次数