小编Cha*_*nhm的帖子

AnimationController 未定义命名参数“vsync”

AnimationController 停止工作,因为不知何故 vsync 不再是命名参数。

这行代码停止工作。

controller = AnimationController(duration: Duration(seconds: 3), vsync: this);

它现在显示一个错误说:

The named parameter 'vsync' isn't defined.
Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'vsync'.dartundefined_named_parameter
Run Code Online (Sandbox Code Playgroud)

我在两个不同的应用程序中使用了这个完全相同的代码,在其中一个应用程序中我只是删除了淡入淡出的文本动画作为热修复,但在另一个应用程序中我需要一个真正的修复。最近有人看到这个问题吗?

笔记:

- 这个完全相同的代码已经工作了几个月,但在更新后停止工作。

- 周围的班级确实有: with TickerProviderStateMixin

class FadingText extends StatefulWidget {
  final String text;
  final int seconds;
  final TextStyle style;

  FadingText({this.text, this.seconds, this.style});

  @override
  _FadingTextState createState() => _FadingTextState();
}

class _FadingTextState extends State<FadingText> with TickerProviderStateMixin {
  AnimationController controller;
  Animation animation; …
Run Code Online (Sandbox Code Playgroud)

dart flutter animationcontroller

77
推荐指数
7
解决办法
3万
查看次数

在 Flutter 中截取特定 Widget 的屏幕截图?

我有一个带有图像和一些信息的小部件,我希望用户能够将其保存为图像并共享。

有谁知道如何在不特别告诉用户实际截取屏幕截图的情况下完成此操作?

screenshot flutter

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

响应EKEventEditViewController中的"取消"或"完成"

我正在使用EKEventEditViewController,我可以填充我需要的信息.我被授予访问日历和所有内容的权限.我的问题是当我点击"取消"没有任何反应.当我点击"完成"时,我收到错误消息,表示没有设置日历,没有设置日期,"事件不属于该事件存储".

我不认为我的didCompleteWithAction委托方法被调用.

我的viewController符合:

@interface EventoViewController : UIViewController <EKEventEditViewDelegate>
Run Code Online (Sandbox Code Playgroud)

当我尝试将self设置为delegate时,我收到错误:

sending EventoViewController *const__strong' to parameter of incompatible type 'id<UINavigationControllerDelegate>'
Run Code Online (Sandbox Code Playgroud)

原始代码.h

#import <UIKit/UIKit.h>
#import <EventKit/EventKit.h>
#import <EventKitUI/EventKitUI.h>

@interface EventoViewController : UIViewController <EKEventEditViewDelegate>

@property (weak, nonatomic) IBOutlet UILabel *eventDetailTitleLabel;
@property (weak, nonatomic) IBOutlet UILabel *eventDetailDateLabel;
@property (weak, nonatomic) IBOutlet UILabel *eventDetailDescriptionLabel;


- (IBAction)closeModalView:(id)sender;
- (IBAction)addEventToNative:(id)sender;


@end
Run Code Online (Sandbox Code Playgroud)

原来的.m

#import "EventoViewController.h"



@implementation EventoViewController

@synthesize eventDetailTitleLabel, eventDetailDateLabel, eventDetailDescriptionLabel;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    } …
Run Code Online (Sandbox Code Playgroud)

nscalendar ios ekevent

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

在现有项目中实现CoreData(XCode 4.2)

我有一个非常简单的(初学者)应用程序,我想添加持久性.在我创建项目时使用XCode 4.2没有"使用CoreData选项"所以现在我有我的视图和所有设置我无法找到添加CoreData Framework的方法.

我一直在阅读,大多数地方都说,如果你不选择"使用CoreData",你将会缺少项目中非常重要的代码,所以我甚至想知道是否有可能在我的项目进展时实现它. ..

我感谢您的帮助!

iphone core-data xcode4 ios5

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