我刚刚在Firebase上看到一个名为In-App Messaging的新功能.是否已经有一个想法如何让这与Flutter一起工作?
似乎XCode 6在使用viewwithtags然后XCode 5是不同的.
我在XCode 6中使用以下代码与Storyboard.创建了50个单元格,但标签不可见.所有内容都设置正确,如标签等.如果我使用"旧"XCode 5方式使用注册单元格分类它似乎适用于iOS 7但在iOS 8中的数据在我开始滚动之前,不会传递给标签.
static NSString * const reuseIdentifier = @"MyCell";
- (void)viewDidLoad {
[super viewDidLoad];
// Register cell classes
[self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:reuseIdentifier];
}
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
return 1;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return 50;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:reuseIdentifier forIndexPath:indexPath];
UILabel *nameLabel = (UILabel *)[cell viewWithTag:102];
nameLabel.text = @"Hello World";
nameLabel.textColor = [UIColor whiteColor];
cell.backgroundColor = [UIColor blueColor];
return cell;
}
Run Code Online (Sandbox Code Playgroud)
更新后的答案,但在iOS 8下,第一个单元格不会显示内容.只有在向上和向下滚动后,内容才会加载到标签. …
ios uicollectionview uicollectionviewcell viewwithtag xcode6
当我尝试从 Flutter 调用可调用函数时,在使用 Firebase Cloud Functions 时遇到错误。
flutter: caught generic exception
flutter: PlatformException(functionsError, Firebase function failed with exception., {message: NOT FOUND, code: NOT_FOUND})
Run Code Online (Sandbox Code Playgroud)
这是我尝试使用 cloud_functions 调用云函数的方法:^0.4.2+3
import 'package:cloud_functions/cloud_functions.dart';
_check(String id) async {
HttpsCallable callable = CloudFunctions.instance
.getHttpsCallable(functionName: 'checkUserFavorites');
try {
final HttpsCallableResult result = await callable.call(
<String, dynamic>{
'id': id,
},
);
print(result.data);
} on CloudFunctionsException catch (e) {
print('caught firebase functions exception');
print(e.code);
print(e.message);
print(e.details);
} catch (e) {
print('caught generic exception');
print(e);
}
}
Run Code Online (Sandbox Code Playgroud) 我正在将一个BottomNavigationBar与一个TabController一起使用。通过单击BottomNavigationBar的不同选项卡,TabView可以更改内容。但是,如果我在TabView上滑动以切换到另一个视图/选项卡,则BottomNavigationBar不会更新为我滑动至的选项卡。我已经在TabController中添加了一个侦听器以检测更改。但是,如何以编程方式更新BottomNavigationBar以反映更改?