- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我在学习Flutter的过程中摸索着,到目前为止,我想做的事情已经很成功了,但是这个问题一直很困扰。
我有一个项目的 ListView,我希望能够让用户长按一个项目,然后从一对命令中进行选择。我真的找不到我喜欢的弹出菜单解决方案,所以我想,为什么不在 SubTitle 中放两个 RaisedButton,因为它需要一个 Widget。
我已经按照我的意愿在其中设置了按钮,但我希望在页面首次加载时隐藏副标题,然后在用户长按时显示。
当前代码如下:
new ListTile(
title: new Text(
_players[index].name,
style: regularTextStyle,
),
subtitle: new Visibility(
child: new Row(children: <Widget>[
new RaisedButton.icon(
icon: new Icon(Icons.delete),
label: new Text(Constants.DeletePlayer),
onPressed: null),
new Padding(padding: EdgeInsets.fromLTRB(10, 0, 0, 0)),
new RaisedButton.icon(
icon: new Icon(Icons.edit),
label: new Text(Constants.EditPlayer),
onPressed: null)
]),
visible: false,
),
trailing: new Icon(
_players[index].selected
? Icons.check_box
: Icons.check_box_outline_blank,
color: _players[index].selected ? Colors.blue : null,
),
onTap: () {
setState(() {
_players[index].toggle();
});
},
onLongPress: () {
setState(() {
});
},
如何从 onLongPress 处理程序中访问 ListTile 的 Subtitle 属性?
最佳答案
您可以只使用 StatefulWidget
并在长按 ListTile
后使用 setState
重建小部件。
检查这个示例:
class MyApp extends StatefulWidget {
@override
MyAppState createState() => MyAppState();
}
class MyAppState extends State<MyApp> {
bool isVisible = false;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: ListTile(
title: Text("Title"),
onLongPress: () {
setState(() {
isVisible = !isVisible;
});
},
subtitle: isVisible ? Text("Subtitle sample") : null,
)));
}
}
关于flutter - 如何以编程方式访问 ListTile.Subtitle?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53675372/
我正在编写一个 python 脚本来解析 VTT 字幕文件。我正在使用正则表达式来匹配和提取特定元素: '在时间码' '输出时间码' '其他信息'(主要是对齐信息,如对齐:中间或行:-1) 字幕内容(
我正在使用修改后的kanderson-well beats委托版本来修改AVKit需要的请求。所有代码将在帖子的底部。修改请求、创建字幕播放列表并将它们添加到主播放列表中是很好的,因为它们在请求AVM
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 已关闭 4 个月前。 Improve
我在学习Flutter的过程中摸索着,到目前为止,我想做的事情已经很成功了,但是这个问题一直很困扰。 我有一个项目的 ListView,我希望能够让用户长按一个项目,然后从一对命令中进行选择。我真的找
我正在创建一个 HTML5 视频播放器,并且想要一个可以打开和关闭字幕的按钮。为了关闭它们,我将默认轨道的“模式”属性设置为“隐藏”,但它们并没有在 Chrome 66 中消失。 这是应该关闭字幕的
我有一个带有 rightButtonItem 的导航栏和另一个带有 right&leftButtonItem 的导航栏。 我练习尝试使用带有子标题的导航栏,但是当我将标题和子标题字符串设置得很长时。
在我的应用程序中,我使用 Apple 的 KMLViewer 来显示我从 KML 文件中获取的注释。在文件 KMLParser.m 中,有一个实例变量 placemarkDescription 用于转
我正在开发一个 jekyll 页面。 在相关页面上,我想展示一系列图片。 我想显示图像的副标题,但仅在单击缩略图时显示,即显示放大图像时。理想情况下,它应该有一个半透明的背景,字体颜色应该是白色。
我的 Activity 使用 ActionBar.setSubtitle 函数来显示当前显示的文件系统位置的完整路径。这意味着接近字幕末尾的子字符串比开头更相关,所以我想我会覆盖 ActionBar
有没有什么应用。哪个可以从 .vtt 转换为 .srt 格式?我尝试了不支持 .vtt 的字幕编辑器。如果有人知道任何特定的应用程序。可以用来做同样的事情,请分享。 最佳答案 使用 subconv 你
我正在使用 MPMoviePlayerViewController 播放直播视频我想禁用“音频和字幕”的右下角按钮。我找到的唯一解决方案是设置 moviePlayer.controlStyle属性(p
实例代码在这里:http://jsfiddle.net/inspiredtolive/5t8fbod2/ 我更改了第二个视频的视频源,突然之间,视频甚至无法加载。 删除 cro
我实际上正在构建一个网站,我使用 Bootstrap,因为它非常高效,并确保每个人都有可能了解我的网站是如何工作的。 但事实是,我正在尝试使用模式来显示一些内容,我需要在其中添加一个副标题,我已经尝试
作为标题,我想对一些包含字幕的 mkv 视频进行硬编码。这些潜艇可能是 ASS、SRT 或基于图片的。 我已经阅读了 FFmpeg 文档和资料,但只有在 sub 的类型已知的情况下才找到刻录 sub
无论字体大小如何,我都想垂直居中对齐视频上的文本。如果有人可以指导如何将几列向上移动几行,则可能可以使用drawtext过滤器和字幕过滤器以及字幕过滤器来完成。 我尝试了多个 [in]drawtext
当我尝试颤动播放声音文件时,它显示“字幕 Controller 已设置”。 这是我的代码: import 'package:flutter/material.dart'; import 'packag
新的 iOS 13 共享表提供了一个漂亮的标题,显示正在共享的项目的上下文。 不过我还不知道如何更改项目描述。我使用了 ActivityViewControllerLinkMetadata 函数,它部
我有一个tableViewCell let cell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier:
观看直播时,字幕菜单选项仍显示在视频 View 中。如何隐藏完整的字幕组?如果显示应该由m3u8来管理,那么m3u8必须如何显示字幕菜单消失? 最佳答案 字幕嵌入到 HLS 流中。 AVPlayerV
是否可以将 HTML 文件中字幕轨道的来源设为 JavaScript 字符串?例如,TextArea 的上下文? 概念 HTML: WEBVTT .
我是一名优秀的程序员,十分优秀!