- 如何创建
ListView
仅在特定区域可见的小部件?
为什么我需要这个小部件?
我想创建这样一个小部件,以便在滚动某个小部件时,我可以scrollNotification.metrics.pixels
为该小部件从屏幕顶部的平滑退出设置动画。
为了让这个小部件中的元素发生漂亮的变化(旧文本向上,新文本从底部出来),我相信ListView
这是最简单的方法。
- 我想知道。也许这个小部件有某种已经存在的名称,并且它已经在 pub.dev 中。
如何删除子小opacity
部件内的特定小opacity
部件?
我不能删除不透明度,但只能让它更透明opacity: 1
是行不通的
Opacity(
opacity: 0.5,
child: Card(
child: Opacity(
opacity: 1,
child: Container(child: event.text),
),
),
),
添加后:
return SliverList(
delegate: SliverChildBuilderDelegate((contextSli, indexSli) {
ListView
变得无限(项目结束并重新开始)。
如何修复列表无穷大?
Widget build(BuildContext context) {
return SliverList(
delegate: SliverChildBuilderDelegate((contextSli, indexSli) {
return ListView.builder(
physics: physics,
shrinkWrap: shrinkWrap,
itemCount: itemCount,
controller: controller,
reverse: reverse,
primary: primary,
itemBuilder: (context, i) {
final TimelineModel model = itemBuilder(context, i);
model.isFirst = reverse ? i == (itemCount - 1) : i == 0;
model.isLast = reverse ? i == 0 : i == (itemCount - 1);
switch (position) {
default:
return TimelineItemLeft(properties: properties, model: model);
}
});
}),
);
}
为什么deleteTimerString没有更新
Widget ListItem(.......) {
String deleteTimerString = '';
const oneSec = const Duration(seconds: 1);
Timer.periodic(
oneSec,
(Timer timer) => setState(
() {
DateTime now = DateTime.now();
Duration diff = DateTime.parse(currentSorol.deleteDate).difference(now);
deleteTimerString = diff.toString();
},
),);
return Container(
..............
ListTile(
title: Text(
deleteTimerString
..............
);
}
还有. view A
_ 在那。当从到through的转换触发附加到 的函数时。如果我不在,我不需要工作view B
А
FutureBuilder
view А
view B
Navigator.Push()
FutureBuilder
view A
FutureBuilder
view
Futurebuilder
这是代码“视图A”(_StoriesState),当我转到B(StoriesPage)时,会调用getStories函数,该函数只能在A(_StoriesState)中调用
............
Future<dynamic> getStories(int items, List<int> pickerSelectedIndex) async {
try {
............
return stories;
} on HandshakeException catch (e) {
print("HE: " + e.toString());
getStories(items, pickerSelectedIndex);
} on SocketException catch (e) {
print("SE: " + e.toString());
getStories(items, pickerSelectedIndex);
} on Exception catch (e) {
print(e);
getStories(items, pickerSelectedIndex);
}
}
............
class _StoriesState extends State<Stories> {
Future<List<Story>> listViewData;
............
Future<List<Story>> getStoriesDataReady(
int items, List<int> pickerSelectedIndex) async {
List<Story> stories = await getStories(items, pickerSelectedIndex);
if (globals.filter.isEmpty) {
return stories;
} else {
............
return searchStories;
}
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return FutureBuilder(
future: ............
builder: (BuildContext context, AsyncSnapshot snapshot) {
List<Widget> children;
if (snapshot.hasData) {
listViewData =
getStoriesDataReady(globals.items, pickerSelectedIndex);
return Scaffold(
body: FutureBuilder<List<Story>>(
future: listViewData,
builder: (BuildContext context,
AsyncSnapshot<List<Story>> snapshot) {
if (snapshot.hasData) {
............
child: FloatingSearchBar.builder(
............
itemCount: snapshot.data.length + 1,
itemBuilder:
(BuildContext context, int index) {
............
onTap: () {
............
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => StoryPage(............)),
).then((value) {
FocusScope.of(context).requestFocus(FocusNode());
});
}
............
}),
............
});
}
}
请告诉我如何实现这个?
我在哪里可以阅读“创建社交网络之前需要了解的内容”。我的意思是使用条款、GDPR、隐私政策,也许还有其他我不知道的东西。android的应用程序几乎准备好了,它包含在类别中,社交网络,有注册。
$result = file_get_contents("http://pogoda.ee");
preg_match( '/<td id="L_R_tl".?(.*?)<\/td>/is', $result , $links );
print_r($links);
网站上的标签中有文本,但在文件获取内容中没有
如何制作它,因此标签中不会为空
echo '<ul>';
while ($row = mysql_fetch_object($res)) {
$mes = $row->message;
$format = "<li class='message'>%s</li>";
sprintf($format,$mes);
}
echo '</ul>';
哪里错了
$mes = $row->message;
$format = "<li class='message'>%s</li>";
sprintf($format,$mes);
$("#button").bind("click", function () {
var messageLenght = $("#text").length();
if($('#text').val() != '' && messageLenght < 200 ){
var message = $("#text").val();
$.ajax({
url: "chatGetMsg.php",
type: "POST",
data: {message},
dataType: "json",
complete: function () {
show('send');
del();
}
});
}
});
为什么不起作用
messageLenght < 200
js执行的太快怎么设置及时执行
<button id="button" onclick="$(function()
{
var chat_scroll = $('#content');
chat_scroll.scrollTop(chat_scroll.prop('scrollHeight'));
});" >send</button>
不是所有的代码
<div class="box">
<div id="content"><?php include("chatGetMsg.php"); ?></div>
<div id="textarea"><textarea id="text" name='message' maxlength="200"></textarea></div>
<div id="send"><button id="button" onclick="$(function()
{
var chat_scroll = $('#content');
chat_scroll.scrollTop(chat_scroll.prop('scrollHeight'));
});" >send</button></div>
</div>
<div class="Chan"></div>
阿贾克斯
$(document).ready(function () {
show();
setInterval(show, 300);
$("#button").bind("click", function () {
var message = $("#text").val();
$.ajax({
url: "chatGetMsg.php",
type: "POST",
data: {message},
dataType: "json"
});
});
function show() {
$.ajax({
url: "chatGetMsg.php",
cache: false,
success: function (html) {
$("#content").html(html);
}
});
}
});
当我开始在文本字段中书写时,它没有被写入,它被更新并且网站开始严重滞后。该怎么办?
[聊天.php]
<?php> session_start();
header('Content-Type: text/html; charset=utf-8');
?>
<html>
<head>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
</head>
<script type="text/javascript">
// setTimeout("window.location.reload()",3000);
</script>
<body>
<script>
$(document).ready (function (
){ show();setInterval('show()',5000);
$("#button").bind("click", function (){
var message = $("#text").val();
$.ajax ({
url: "chat.php",
type: "POST",
data: {message},
dataType: "json"
});
});
});
function show()
{
$.ajax({
url: "chat.php",
cache: false,
success: function(html){
$("#content").html(html);
}
});
}
</script>
<div id="content">
<?php
include("config.php");
if(isset($_POST['message'])){
$sql = "insert into `messages` (`message`) values ('".$_SESSION['login'].": ".$_POST['message']."')";
mysql_query($sql);
}
$sql = "select message from `messages` ORDER BY id desc LIMIT 10";
$res = mysql_query($sql);
if($res)
{
while($row = mysql_fetch_object($res))
{
printf("<ul type='none'><li>%s</li></ul>",$row->message);
}
}
else
{
echo "<p> <b>Error: ".mysql_error()."</b> </p>";
exit();
}
?>
<input type='text' id="text" name='message'>
<button id="button">Saada</button>
</div>
</body>
</html>
我需要向数据添加什么:并使其发送消息文本字段的值
<html>
<head>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
</head>
<body>
<iframe name='chatWindow' id='chatWindow'frameborder="no" height="935" width="1910" src='iframe.php'>Chat</iframe>
<br> <input type='text' id="text" name='message'>
<input type='button' id="button" value="send">
<script>
$(document).ready (function () {
$("#button").bind("click", function (){
$.ajax ({
url: "iframe.php",
type: "POST",
data: ({}),
dataType: "PHP"
});
});
});
</script>
</body>
</html>
您如何在代码中交换“firstname”(“Martin”)和数组名称(“Krönström”),或者更确切地说,如何在第一个 foreach 循环中为 赋值$firstname = $lastnames[$key]['firstname'];
,然后在 中使用它$newlastnames[$firstname]["firstname"] = $key;
?
请解释什么,分配在funcion a
哪里?
function a ($lastnames){
$newlastnames;
foreach($lastnames as $key => $value){
$firstname = $lastnames[$key]['firstname'];
$newlastnames[$firstname]["firstname"] = $key;
$newlastnames[$firstname]["age"] = $lastnames[$key]['age'];
$newlastnames[$firstname]["sex"] = $lastnames[$key]['sex'];
echo $lastnames[$key]['firstname'].'<br>';
}
return $newlastnames;
}
整个代码在这里
$lastnames = array(
"Krönström" => array("firstname" => "Martin", "age" => 20, "sex" => "male"),
"Kulper" => array("firstname" => "Laura-Liis", "age" => 17, "sex" => "female"),
"Ööbik" => array("firstname" => "Tõnis", "age" => 21, "sex" => "male"),
"Mitri" => array("firstname" => "Martten", "age" => 35, "sex" => "male"),
"Lõsenko" => array("firstname" => "Evelina", "age" => 16, "sex" => "female"),
"Reinaus" => array("firstname" => "Richard", "age" => 21, "sex" => "male"));
$newlastnames = a($lastnames);
saveFile($newlastnames);
function saveFile($lastnames){
file_put_contents("q.json",json_encode($lastnames));
}
function a ($lastnames){
$newlastnames;
foreach($lastnames as $key => $value){
$firstname = $lastnames[$key]['firstname'];
$newlastnames[$firstname]["firstname"] = $key;
$newlastnames[$firstname]["age"] = $lastnames[$key]['age'];
$newlastnames[$firstname]["sex"] = $lastnames[$key]['sex'];
echo $lastnames[$key]['firstname'].'<br>';
}
return $newlastnames;
}
function sortA($lastnames,$sortValue){
foreach($lastnames as $key => $value){
if($sortValue == "firstname"){
$throwArray[$key] = $key;
}else{
$throwArray[$key] = $value[$sortValue];
}
}
array_multisort($throwArray, SORT_DEC, $lastnames);
return $lastnames;
}
我创建了表单 Form1.cs 的副本并将新表单命名为 Form2 并且在程序的每次构建中 Form2 变得与 Form1 相同,我只需要将 Form1 复制到 Form2 并更改 Form2
而且我还无法以任何方式更改 Form2 和这些方块......
我添加一个新窗体,选择一个派生窗体,
然后选择 Form1 窗体
并在屏幕上创建一个 Form2 的副本,我已经创建了它
我需要为自己更改此副本,
但它不允许自己更改
如何制作我可以更改的副本