首页 文章 精选 留言 我的

精选列表

搜索[弹出窗口],共10001篇文章
优秀的个人博客,低调大师

ios23--动画做弹出提示框toast

if (self.shopCarView.subviews.count == 0) { /* [UIView animateWithDuration:2.0 animations:^{ // 执行动画 self.showHUB.text = @"当前购物车已空,赶紧买买买~"; self.showHUB.alpha = 1.f; } completion:^(BOOL finished) { // 完成 [UIView animateWithDuration:1.0 delay:1.0 options:UIViewAnimationOptionCurveLinear animations:^{ self.showHUB.alpha = 0; } completion:nil]; }]; */ [self showWithInfo:@"当前购物车已空,赶紧买买买~"]; } } @property (weak, nonatomic) IBOutlet UILabel *showHUB; //提示文字,刚开始是隐藏的。连线连过去的。 - (void)showWithInfo: (NSString *)info{ [UIView animateWithDuration:2.0 animations:^{ // 执行动画 self.showHUB.text = info; self.showHUB.alpha = 1.f; } completion:^(BOOL finished) { // 完成 [UIView animateWithDuration:1.0 delay:1.0 options:UIViewAnimationOptionCurveLinear animations:^{ self.showHUB.alpha = 0; } completion:nil]; }]; } 本文转自农夫山泉别墅博客园博客,原文链接:http://www.cnblogs.com/yaowen/p/7469657.html,如需转载请自行联系原作者

优秀的个人博客,低调大师

鸿蒙js开发7 鸿蒙分组列表和弹出menu菜单

鸿蒙入门指南,小白速来!从萌新到高手,怎样快速掌握鸿蒙开发?【课程入口】 目录: 1.鸿蒙视图效果 2.js业务数据和事件 3.页面视图代码 4.跳转页面后的视图层 5.js业务逻辑部分 6.《鸿蒙js开发》系列文章合集 任正非:现在华为必须全面靠自己打造产品,要敢于将鸿蒙推入竞争,星光不问赶路人,时光不负有心人 1.鸿蒙视图效果 点击menu菜单一项,跳转页面,底部菜单栏和轮播布局和轮播图 2.js业务数据和事件 import prompt from '@system.prompt'; import router from '@system.router'; export default { data: { title: 'World', fundatas:[{"fathermenu":"员工管理","childmenu":[{"icon":"/common/emp.png","text":"查询员工"},{"icon":"/common/emp.png","text":"添加员工"},{"icon":"/common/emp.png","text":"删除员工"},{"icon":"/common/emp.png","text":"更新员工"}]}, {"fathermenu":"客户服务","childmenu":[{"icon":"/common/customer.png","text":"一卡通兑"},{"icon":"/common/customer.png","text":"银联服务"},{"icon":"/common/customer.png","text":"票据业务"}]}, {"fathermenu":"内部管理","childmenu":[{"icon":"","text":""},{"icon":"","text":""},{"icon":"","text":""}]}, {"fathermenu":"合同管理","childmenu":[{"icon":"","text":""},{"icon":"","text":""},{"icon":"","text":""}]}, {"fathermenu":"资产管理","childmenu":[{"icon":"","text":""},{"icon":"","text":""},{"icon":"","text":""}]}, {"fathermenu":"绩效管理","childmenu":[{"icon":"","text":""},{"icon":"","text":""},{"icon":"","text":""}]}, ] }, clickitem(itemvalue) { if(itemvalue=="查询员工") { this.$element("menu").show({ x: 360, y: 120 }); //this.$element("menu").show(); } prompt.showToast({ message:"点击了菜单"+itemvalue }) }, menuSelected(e) { prompt.showToast({ message:"你选择查询的值是:"+e.value }) router.push({ uri:"pages/index/index" }) } } 3.页面视图代码 <div class="container"> <list class="listview"> <block for="{{fundatas}}"> <list-item-group class="groupview"> <list-item class="listitem"> <text class="tv1">{{$item.fathermenu}}</text> </list-item> <block for="{{ (index,value) in $item.childmenu}}"> <list-item class="listitemone" onclick="clickitem({{value.text}})"> <image class="cimg" src="{{value.icon}}"></image> <text class="tv2">{{value.text}}</text> </list-item> </block> </list-item-group> </block> </list> <menu id="menu" title="员工性别" onselected="menuSelected"> <option value="男性员工"> 男性员工 </option> <option value="女性员工"> 女性员工 </option> </menu> </div> 3.样式代码 .container { width: 100%; height: 1200px; } .listview{ width: 100%; height: 100%; } .groupview{ width: 100%; height: 46%; border-bottom: 5px solid #DCDCDC; } .listitem{ width: 100%; height: 20%; display: flex; justify-content: space-around; } .listitemone { width: 50%; height: 6%; border-bottom: 1px solid #DCDCDC; display: flex; justify-content: space-around; } .cimg{ width: 40px; height: 40px; } .tv1{ font-size: 35px; font-weight: bold; font-family: sans-serif; letter-spacing: 10px; } .tv2{ font-size: 34px; font-weight: bold; font-family: sans-serif; } 4.跳转页面后的视图层 <div class="pageview"> <swiper class="swiperview" id="swiper" index="0" > <div class ="sw1"> <swiper class="swiper1" id="swiper1" autoplay="true" index="0" indicator="true" loop="true" digital="false"> <div class = "swiperContent1" > <text class = "text" value="轮播图1"></text> </div> <div class = "swiperContent1"> <text class = "text" value="轮播图2"></text> </div> <div class = "swiperContent1"> <text class = "text" value="轮播图3"></text> </div> </swiper> <swiper class="swiper2" loop="true" vertical="true" indicator="false" autoplay="true"> <div class="lineview"> <text>1.鸿蒙</text> </div> <div class="lineview"> <text>2.苹果</text> </div> <div class="lineview"> <text>3.安卓</text> </div> </swiper> </div> <div class ="sw2"> <list class="todo-wraper"> <list-item for="{{todolist}}" class="todo-item"> <text class="todo-title">{{$item.title}}</text> <text class="todo-title">{{$item.date}}</text> </list-item> </list> </div> <div class ="sw3"> <tabs class = "tabs" index="0" vertical="false" onchange="change"> <tab-bar class="tab-bar" mode="fixed"> <text class="tab-text">推荐</text> <text class="tab-text">视频</text> <text class="tab-text">本地</text> <text class="tab-text">内容</text> </tab-bar> <tab-content class="tabcontent" scrollable="true"> <div class="item-content" > <div class="currentview"> <div class="leftview"><text class="infot1">{{weatherInfo.city}}</text></div> <div class="rightview1"> <div class="cell"><text>{{winfo.info}}</text></div> <div class="cell"><text>{{winfo.direct}}</text></div> <div class="cell"><text>{{winfo.power}}</text></div> </div> </div> <div class="nextview"> </div> </div> <div class="item-content" > <text class="item-title">第二个</text> </div> <div class="item-content" > <text class="item-title">第三个</text> </div> <div class="item-content" > <text class="item-title">第四个</text> </div> </tab-content> </tabs> </div> <div class ="sw4"> <text>第四幅</text> </div> </swiper> <div class="bottommenu"> <div for="{{menus}}" class="menubox" onclick="changemenu({{$idx}})"> <image src="{{currentdata==$idx?$item.path:$item.path1}}" class="cimg"></image> <text class="menutitle">{{$item.menu}}</text> </div> </div> </div> 5.js业务逻辑部分 import fetch from '@system.fetch'; export default { data: { weatherInfo:{}, winfo:{}, nextInfo:[], currentdata:0, title: "", menus:[{menu:"首页","path":"./common/ones.png","path1":"./common/oneu.png"}, {menu:"分类","path":"./common/cs.png","path1":"./common/cu.png"}, {menu:"内容","path":"./common/cons.png","path1":"./common/conu.png"}, {menu:"我的","path":"./common/mys.png","path1":"./common/myu.png"}], todolist: [{ title: '刷leetcode', date: '2020-06-25 10:00:00', }, { title: '看电影', date: '2020-06-27 20:00:00', }, { title: '刷leetcode', date: '2020-06-25 10:00:00', }, { title: '看电影', date: '2020-06-27 20:00:00', },{ title: '刷leetcode', date: '2020-06-25 10:00:00', }, { title: '看电影', date: '2020-06-27 20:00:00', },{ title: '刷leetcode', date: '2020-06-25 10:00:00', }, { title: '看电影', date: '2020-06-27 20:00:00', }, { title: '刷leetcode', date: '2020-06-25 10:00:00', }, { title: '看电影', date: '2020-06-27 20:00:00', }, { title: '刷leetcode', date: '2020-06-25 10:00:00', }, { title: '看电影', date: '2020-06-27 20:00:00', },{ title: '刷leetcode', date: '2020-06-25 10:00:00', }, { title: '看电影', date: '2020-06-27 20:00:00', },{ title: '刷leetcode', date: '2020-06-25 10:00:00', }, { title: '看电影', date: '2020-06-27 20:00:00', },{ title: '刷leetcode', date: '2020-06-25 10:00:00', }, { title: '看电影', date: '2020-06-27 20:00:00', }, { title: '刷leetcode', date: '2020-06-25 10:00:00', }, { title: '看电影', date: '2020-06-27 20:00:00', },{ title: '刷leetcode', date: '2020-06-25 10:00:00', }, { title: '看电影', date: '2020-06-27 20:00:00', },{ title: '刷leetcode', date: '2020-06-25 10:00:00', }, { title: '看电影', date: '2020-06-27 20:00:00', } ] }, onInit() { // this.title = this.$t('strings.world'); let that =this; fetch.fetch({ url:"http://apis.juhe.cn/simpleWeather/query?city=南京&key=3dc98f3428c44424088015738a070554", responseType:"json", success:function(resp) { let currentValue=JSON.parse(resp.data); that.weatherInfo=currentValue.result; that.winfo=currentValue.result.realtime; // that.nextInfo=currentValue.future; } }) }, changemenu(index) { this.currentdata=index; this.$element('swiper').swipeTo({index: index}); } } 5.样式代码 .pageview{ width: 100%; height: 1600px; background-color: azure; } .bottommenu{ width: 100%; height: 140px; background-color: snow; border-top: 10px solid black; z-index:999; position: fixed; left: 0px; bottom: 0px; display: flex; justify-content: center; align-items: center; } .menubox{ width: 22%; height: 90%; /**border:9px solid #ccff6a;**/ margin-left: 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; } .menutitle{ color: black; font-weight: bold; letter-spacing: 4px; } .cimg{ width: 40px; height: 40px; } .swiperview{ width: 100%; height: 100%; } .sw1{ width: 100%; height: 100%; display: flex; flex-direction: column; } .sw2{ width: 100%; height: 100%; background-color: cornflowerblue; } .sw3{ width: 100%; height: 100%; background-color: #ccff6a; } .sw4{ width: 100%; height: 100%; background-color: #009865; } .swiper1 { width: 100%; height: 330px; border: 1px solid #000000; indicator-color: #cf2411; indicator-size: 14px; indicator-bottom: 20px; indicator-right: 30px; margin-top: 100px; } .swiperContent1 { width: 800px; height: 100%; justify-content: center; } .button { width: 70%; margin: 10px; } .text { font-size: 40px; } .swiper2{ width: 100%; height: 100px; background-color: powderblue; } .lineview{ width: 100%; height: 100%; } .todo-wraper { width: 100%; height: 100%; } .todo-item { width: 100%; height: 80px; flex-direction: row; display: flex; } .todo-title { width: 454px; height: 40px; text-align: center; } .tabs { width: 100%; } .tab-bar { margin: 10px; height: 60px; border-color: #007dff; border-width: 1px; } .tab-text { width: 300px; text-align: center; } .tabcontent { width: 100%; height: 80%; justify-content: center; } .item-content { height: 100%; justify-content: center; display: flex; flex-direction: column; } .item-title { font-size: 60px; } .currentview{ width: 100%; height: 30%; border-bottom: 4px solid peru; display: flex; } .nextview{ width: 100%; height: 70%; } .leftview{ width: 30%; height: 100%; border-right: 2px solid paleturquoise; border-bottom: 2px solid paleturquoise; display: flex; justify-content: center; align-items: center; } .rightview1{ width: 70%; height: 100%; display: flex; flex-direction: column; } .infot1{ font-family: 楷体; font-size: 80px; color: snow; font-weight: bold; letter-spacing: 5px; } .cell{ width: 100%; height: 30%; border:1px solid red; } 作者:六合李欣 想了解更多内容,请访问: 51CTO和华为官方战略合作共建的鸿蒙技术社区https://harmonyos.51cto.com

优秀的个人博客,低调大师

ASP.NET弹出式日历选择控件的实现

: 在需要调用日期选择的页面放置两个TEXTBOX与BUTTON以选择开始时间与结束时间,并在html代码的</body>之前加入如下javascript语句: <script language="javascript"> functionopenModeBegin() { var returnValue=window.showModalDialog("CalendarForm2.aspx",Form1.TextBoxBeginDate.value); Form1.TextBoxBeginDate.value=returnValue; } </script> <script language="javascript"> functionopenModeEnd() { var returnValue=window.showModalDialog("CalendarForm2.aspx",Form1.TextBoxEndDate.value); Form1.TextBoxEndDate.value=returnValue; } </script> 以上语句定义了两个模态对话框,当调用模态对话框时打开CalendarForm2.aspx页面选择日期,本页面窗体FORM名称为Form1,两个TextBox分别接收传递进来的两个时间值而且应该能互不影响。注意html中窗体的定义应该与javascript中定义的对应并且应该是服务器端运行的,如<form id="Form1" method="post" runat="server">。 在本页面WebForm1.aspx.cs代码部分页面加载Page_Load事件内加入如下语句将定义的javascript行为赋予Button: ButtonBeginDate.Attributes.Add("onclick", "openModeBegin()"); ButtonEndDate.Attributes.Add("onclick", "openModeEnd()"); CalendarForm2.aspx是个临时容器,提供框架调用CalendarForm3.aspx的内容,以备关掉日期选择窗体后无法完成传值,在其html的Head标记之间应该加入如下语句: <script id="clientEventHandlersJS" language="javascript"> <!--function IFRAME1_onblur() {}//--> </script>CalendarForm2.aspx.cs文件中亦不需要写任何代码,只需在body标记之间加入如下代码: <body runat="server" ID="Body1"> <form id="Form1" method="post" runat="server"> <iframe frameborder="no" src='CalendarForm3.aspx'style="WIDTH: 480px; HEIGHT: 450px" id="IFRAME1" language="javascript" onblur="return IFRAME1_onblur()"></iframe> </form></body> CalendarForm3.aspx我们实际用到的日期选择页面包含一个日历控件与一个Button一个TextBox,此处直接将日历控件Calendar的选定值传给第一个页面WebForm1.aspx更简单,但我们没有这样做,不直接传值主要是考虑到大多数用户的使用习惯,在此将日历控件选中的值传给页面上的TextBox,按下Button后再传给WebForm1.aspx,还可以在用户误选后容易纠正。 CalendarForm3.aspx的html代码如下,此处只是经过调整让视觉上好看而已的示例,可不用下列代码: <HTML> <HEAD> <title>日期选择窗体</title> <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR"> <meta content="JavaScript" name="vs_defaultClientScript"> <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema"> </HEAD> <body id="Mybody" runat="server" ms_positioning="GridLayout"> <form id="Form1" method="post" runat="server"> <asp:calendar id="Calendar1" style="Z-INDEX: 101; LEFT: 32px; POSITION: absolute; TOP: 16px" runat="server" Height="390px" Width="440px" BorderWidth="1px" BackColor="#FFFFCC" DayNameFormat="Full" ForeColor="#663399" Font-Size="8pt" Font-Names="Verdana" BorderColor="#FFCC66" ShowGridLines="True" PrevMonthText="上个月&amp;lt;&amp;lt;" NextMonthText="下个月&amp;gt;&amp;gt;"> <TodayDayStyle ForeColor="#00C000" BackColor="Khaki"></TodayDayStyle> <SelectorStyle BackColor="#FFCC66"></SelectorStyle> <NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC"></NextPrevStyle> <DayHeaderStyle Height="1px" BackColor="#FFCC66"></DayHeaderStyle> <SelectedDayStyle Font-Bold="True" BackColor="MediumPurple"></SelectedDayStyle> <TitleStyle Font-Size="9pt" Font-Bold="True" ForeColor="#FFFFCC" BackColor="#990000"></TitleStyle> <OtherMonthDayStyle ForeColor="#CC9966"></OtherMonthDayStyle> </asp:calendar> <asp:TextBox id="TextBox1" style="Z-INDEX: 102; LEFT: 32px; POSITION: absolute; TOP: 416px" runat="server" Visible="False"></asp:TextBox> <asp:Button id="Button1" style="Z-INDEX: 103; LEFT: 216px; POSITION: absolute; TOP: 412px" runat="server" Text="确 定" BorderColor="SteelBlue" ForeColor="White" BackColor="SteelBlue" Width="81px" Height="30px"></asp:Button></form> </body> </HTML> CalendarForm3.aspx.cs代码中只需加入下列两句完成传值动作: private voidCalendar1_SelectionChanged(object sender, System.EventArgs e) { TextBox1.Text = Calendar1.SelectedDate.ToLongDateString(); } private void Button1_Click(object sender, System.EventArgs e) { Response.Write("<script language=javascript>window.returnValue='" + TextBox1.Text + "';window.close();</script>"); } 自此一个完整的日期选择即可完成,CalendarForm2.CalendarForm3两个页面可以被重复访问,其他页面要调用只需在html中加入本文开头第一段javascript代码即可。 本文转自灵动生活博客园博客,原文链接:http://www.cnblogs.com/ywqu/archive/2008/11/26/1341401.html,如需转载请自行联系原作者

优秀的个人博客,低调大师

iOS开发技巧 - 使用Alerts和Action Sheets显示弹出框

解决方案: (Swift) 使用UIAlertController类 (Objective-C) 使用UIAlertView类 代码: (Swift) import UIKit class ViewController: UIViewController { // 1. define the variable that will hold our alert controller var controller:UIAlertController? override func viewDidLoad() { super.viewDidLoad() // 2. start constructing a simple alert view controller using the alert view style controller = UIAlertController(title: "Title", message: "Message", preferredStyle: .Alert) // 3. simply print out a text to the console when pressed let action = UIAlertAction(title: "Done", style: UIAlertActionStyle.Default, handler: { (paramAction:UIAlertAction!) in println("The Done button was tapped") }) // 4. add the action that we created to the alert controller controller!.addAction(action) } override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) // 5. present the alert controller self.presentViewController(controller!, animated: true, completion: nil) } } (Objective-C) #import "ViewController.h" @interface ViewController () <UIAlertViewDelegate> @end @implementation ViewController ... - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; self.view.backgroundColor = [UIColor whiteColor]; NSString *message = @"Are you sure you want to open this link in Safari?"; UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Open Link" message:message delegate:self cancelButtonTitle:@"No" otherButtonTitles:@"Yes", nil]; [alertView show]; } - (void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { NSString *buttonTitle = [alertView buttonTitleAtIndex:buttonIndex]; if ([buttonTitle isEqualToString:@"Yes"]){ NSLog(@"User pressed the Yes button."); } else if ([buttonTitle isEqualToString:@"No"]){ NSLog(@"User pressed the No button."); } }

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册