我有一个AlertDialog大约有10个控件(文本和TextView)的盒子.这些控件是在ScrollView与AlertDialog,再加上我有2个按钮正面和负面的.我遇到的问题是当弹出软键盘时,两个按钮隐藏在键盘后面.
我在内部视图或对话框中寻找重绘功能.下面是我正在谈论的屏幕截图.

android resize view android-softkeyboard android-alertdialog
在我的应用程序中,我需要检查firebase上我的数据库的给定元素是否具有给定名称的子项.我希望可以通过以下方式使用以下内容来完成:
DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference();
if (rootRef.childExists("name")) {
//run some code
}
Run Code Online (Sandbox Code Playgroud)
我搜索过,但找不到任何有用的东西.
因此,对于Android O,如果您希望每小时收到的不仅仅是一些位置更新,则需要将您的服务作为前台服务运行.
我注意到用于启动前台服务的旧方法似乎确实在O上工作.即
startForeground(NOTIFICATION_ID, getNotification());
Run Code Online (Sandbox Code Playgroud)
根据此处的行为更改指南:https: //developer.android.com/preview/behavior-changes.html
NotificationManager.startServiceInForeground()方法启动前台服务.启动前台服务的旧方法不再有效.
虽然新方法仅在定位O时有效,但似乎旧方法似乎仍适用于O设备,无论是否针对O.
编辑 包括示例:
Google示例项目LocationUpdatesForegroundService实际上有一个工作示例,您可以在其中直接查看问题. https://github.com/googlesamples/android-play-location/tree/master/LocationUpdatesForegroundService
无论是针对API级别25进行定位和编译,还是针对O进行编译(如此处所示:https : //developer.android.com/preview/migration.html#uya),startForeground方法似乎都没有问题.
所以,重现:
服务正在前台运行(通知阴影中的图标显示).即使在运行O的设备上,位置更新也会按预期(每10秒)完成.我在这里缺少什么?
我有以下内容AlertDialog.
showDialog(
context: context,
child: new AlertDialog(
title: const Text("Location disabled"),
content: const Text(
"""
Location is disabled on this device. Please enable it and try again.
"""),
actions: [
new FlatButton(
child: const Text("Ok"),
onPressed: _dismissDialog,
),
],
),
);
Run Code Online (Sandbox Code Playgroud)
我怎么能_dismissDialog()解雇说AlertDialog?
这段代码来自颤动的画廊,我正在努力理解和改编它.我会知道这个语法意味着什么:
class DemoItem<T> {
DemoItem({
this.valueName,
this.hintName,
this.valueSurname,
this.hintSurname,
this.builder,
this.valueToString
}) : textController = new TextEditingController(text: valueToString(valueName));
Run Code Online (Sandbox Code Playgroud)
特别是我知道构造函数之后冒号是什么意思,如果有一种方法来定义另一个TextEditingController,除了已经定义的那个.
先感谢您.
我有一个颤动项目,我正在努力我不能把整个代码导致它超过500行代码所以我会尝试问我的问题就像我使用imp一样简单.代码部分.
我有一个有状态的小部件,并在扩展的类下面的有状态小部件中有一些函数 State<MusicPlayer>
文件 lib\main.dart
只需要一个简单的功能
class MyAppState extends State<MyApp>{
...
void printSample (){
print("Sample text");
}
...
Run Code Online (Sandbox Code Playgroud)
此函数位于主类中的有状态小部件内.
还有另一个文件 lib\MyApplication.dart
这个文件也有一个有状态的小部件,我可以做一些事情,这样我就可以在printSample()这里调用函数..
class MyApplicationState extends State<MyApplication>{
...
@override
Widget build(BuildContext context) {
return new FlatButton(
child: new Text("Print Sample Text"),
onPressed :(){
// i want to cal the function here how is it possible to call the
// function
// printSample() from here??
}
);
}
...
}
Run Code Online (Sandbox Code Playgroud) 我有一个应用程序,只要手机连接到WiFi,它就会更新数据库.我实现了一个Service和BroadcastReceiver这将运行Service(它会告诉我是什么用网络),但问题是我不知道是什么的在添加manifest文件开始BroadcastReceiver当它连接到某种当网络状态发生变化或网络
我正在开发一个应用程序,我需要扫描WiFi网络并显示所有连接设备的列表.
允许用户点击设备,应用程序应显示该特定设备的所有硬件信息.这里的硬件我的意思是 - RAM,存储介质,存储容量,设备名称,设备IP地址等.
现在这个设备可以是xbox,带Linux/Windows的笔记本电脑,iPhone等手机或任何基于Andorid的智能手机甚至是打印机.
如何扫描WiFi网络并查询/检测连接到它的所有设备?
无论在其上运行的操作系统如何,我需要使用哪些协议来获取特定设备中的硬件列表?
我有这个容器:
new Container(
width: 500.0,
padding: new EdgeInsets.fromLTRB(20.0, 40.0, 20.0, 40.0),
color: Colors.green,
child: new Column(
children: [
new Text("Ableitungen"),
]
),
),
Run Code Online (Sandbox Code Playgroud)
当用户点击Container时,我想要一个onPressed方法被触发(例如,可以用IconButtons完成).如何使用容器实现此行为?
提前致谢
android ×6
flutter ×4
dart ×3
java ×2
constructor ×1
firebase ×1
hardware ×1
location ×1
monitoring ×1
networking ×1
resize ×1
view ×1