小编Eri*_*ric的帖子

在HTML文本输入中选择文本时更改突出显示颜色

我一直在网上寻找这个,甚至找不到其他人甚至问这个,更不用说解决方案......

有没有办法在选择文本时更改文本输入中高亮区域的颜色?不是高亮边框或背景,而是当您实际选择文本时文本周围出现的部分.

html css text input highlight

55
推荐指数
5
解决办法
12万
查看次数

动态HTML页面的PHP与JavaScript

通常,当我将动态生成的HTML标记放在一起时,我一直在使用PHP来存储信息,然后循环遍历它以在页面上创建元素.一个例子是导航; 创建一个对象数组,然后循环它们以回显标记.这有助于我在开发或维护期间进行轻微(或主要)更改的时间.

最近我一直在想我是否应该使用JavaScript代替这一点.原理相同,但使用addElement.

只是想对此有所了解; 优点,缺点,php vs js,seo考虑因素等

谢谢大家!

html javascript php seo

21
推荐指数
2
解决办法
5万
查看次数

Icon.png问题(在顶级应用包装器下找不到Info.plist中指定的图标:Icon.png(-19007))

我正在整理一个通用应用程序,我的项目中有图标,但我不断收到编译器关于Icon.png的警告.

我按照http://developer.apple.com/library/ios/#qa/qa2010/qa1686.html上的说明操作,但仍然出现上述错误.

我尝试过以下方法:

将图标放在共享组中,并根据技术说明根据plist添加它们.更改图标路径以添加共享/指向它们以指向共享文件夹.

创建一个资源组(技术说明未指出XCode没有为通用应用程序创建资源组)并将它们移动到该组(我从plist中删除了"Shared /"前缀.)

将图标移动到项目的顶层.

我还仔细检查了图标大小,它们都是正确的,以及每个图标的名称.

我可能错过了什么?

icons packaging ios4

18
推荐指数
4
解决办法
2万
查看次数

Javascript错误:无法将对象转换为原始值

我使用以下javascript代码收到此错误:

function tempTest(evt) {
    alert(evt.currentTarget.id);
    ct = document.getElementById(evt.currentTarget.id);
    rslt = document.getElementById('rslt');
    var props;
    for (var prop in ct) {
        if (ct.hasOwnProperty(prop)) {
            propVal = ct[prop];
            var propDat = prop + ' = ' + propVal;
            props += propDat + '<br/>';
        }
    }
    rslt.innerHTML = props;
}
Run Code Online (Sandbox Code Playgroud)

这让我感到困惑.有任何想法吗?

javascript primitive object

9
推荐指数
1
解决办法
4万
查看次数

NSDate - 抵消时区

我一定是想念她的小事,但无法理解.试图创建一个比较日期,但我似乎无法将currentDate从GMT抵消到EST:

// current date (gmt) //
NSDate *currentDate = [NSDate date];

NSTimeZone *currentDateTimeZone = [NSTimeZone timeZoneWithAbbreviation:@"EST"];

NSDateFormatter *currentDateFormat = [[NSDateFormatter alloc]init];
[currentDateFormat setTimeZone:currentDateTimeZone];
[currentDateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss zzz"];

NSString *currentDateString = [currentDateFormat stringFromDate:currentDate];
NSLog(@"currentDateString: %@", currentDateString); // returns 2011-01-05 13:30:30 EST

NSDate *currentDateWithOffset = [currentDateFormat dateFromString:currentDateString];

NSLog(@"currentDateWithOffset: %@", currentDateWithOffset); // returns 2011-01-05 18:30:30 +0000
Run Code Online (Sandbox Code Playgroud)

谢谢!

编辑:

我正在使用以下行在一个单独的类中调用一个方法(尝试使其成为可移植的):

[Expiration expires:[[NSDate alloc] initWithString:@"2011-01-07 12:00:00 +0000"] within:1.0]
Run Code Online (Sandbox Code Playgroud)

在expires方法中,我有以下几行:

NSComparisonResult comparison = [currentDateWithOffset compare:expires]; // check for a fixed date to disable the demo

double …
Run Code Online (Sandbox Code Playgroud)

objective-c nsdate

7
推荐指数
2
解决办法
1万
查看次数

初始化使得整数指针没有强制转换

好的,我正在努力解决这个问题.我已经搜索了过去的一小时,我不知道我做错了什么.我正在尝试获取发送者的currentTitle,然后将其转换为整数,以便我可以在调用列表中使用它.

NSString *str = [sender currentTitle];
NSInteger *nt = [str integerValue]; // this is where the error appears //
NSString *nextScreen = [NSString stringWithFormat:@"Screen_%@.jpg", [screenList objectAtIndex:nt]];
Run Code Online (Sandbox Code Playgroud)

我认为它与之相关 [str integerValue]没有正确使用,但我找不到一个有效的例子.

谢谢!

pointers objective-c ios

5
推荐指数
1
解决办法
2万
查看次数

半透明状态栏(iPhone/iPad/iPod Touch)

我一直在环顾四周,似乎答案是否定的,但帖子已过时,所以我想知道这是否已经改变.是否可以将状态栏设置为半透明?我试图在多点触控水龙头上做淡入/淡出效果,但状态栏不断变成坚固的黑色.

谢谢!

- 编辑 - 我用于事件转换的代码如下.我已经在-info.plist中将状态栏设置为半透明,但我注意到IB中没有黑色半透明设置(这可能是我的答案:没有半透明状态栏,除非你是Apple.)

-(IBAction)showOptions:(id)sender
{
if ([UIApplication sharedApplication].statusBarHidden == YES) {
    [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];
    [UIView beginAnimations:@"fadeIn" context:nil];
    [UIView setAnimationDuration:0.25];
    [UIView setAnimationCurve:UIViewAnimationCurveLinear];
    optionsView_portrait.alpha = 0.5;
    [UIView commitAnimations];
}
else
{
    [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
    [UIView beginAnimations:@"fadeOut" context:nil];
    [UIView setAnimationDuration:0.25];
    [UIView setAnimationCurve:UIViewAnimationCurveLinear];
    optionsView_portrait.alpha = 0.0;
    [UIView commitAnimations];
}
}
Run Code Online (Sandbox Code Playgroud)

statusbar translucency ios ios-4.2

5
推荐指数
2
解决办法
2万
查看次数

控件库问题:无法从文本'local:SolidGloss'创建'System.Type'

我正在开发一个自定义控件库,我坚持这个错误.谁能告诉我我错过了什么?

SolidGloss.cs:

using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;

namespace UXSDK
{
public class SolidGloss : Control
{

    public SolidGloss()
        : base()
    {
        DefaultStyleKey = typeof(SolidGloss);
        //SolidGlossCorners_ConformToContainer();
    }

    Border SolidGloss_Container;
    Border SolidGloss_Upper;
    Border SolidGloss_Lower;

    public override void OnApplyTemplate()
    {
        SolidGloss_Container = this.GetTemplateChild("SolidGloss_Container") as Border;
        Debug.Assert(SolidGloss_Container != null, "SolidGloss_Container is null");

        SolidGloss_Upper = this.GetTemplateChild("SolidGloss_Container") as Border;
        Debug.Assert(SolidGloss_Container != null, "SolidGloss_Container is null");

        SolidGloss_Lower = …
Run Code Online (Sandbox Code Playgroud)

silverlight custom-controls control-library

3
推荐指数
1
解决办法
7712
查看次数

TinyMCE和Angular 2:基于@Input设置编辑器的内容

tinymce的新手,并且不确定将setContent(this.content)方法实际放在何处。我当前的版本导致我收到错误消息:

TypeError: null is not an object (evaluating 'body.nodeName') --- runTask — zone.js:170

通过查询我的数据库的服务来检索角色对象,该数据库运行正常。

我在persona.component.html中设置了这样的实例:

<app-tinymce
   [elementId]="'persona-footnotes'"
   (onEditorContentChange)="keyupHandler($event)"
   [content]="persona.footnotes"
   ></app-tinymce>
Run Code Online (Sandbox Code Playgroud)

app-tinymce.component.ts:

import {
  Component,
  AfterViewInit,
  EventEmitter,
  OnDestroy,
  Input,
  Output
} from '@angular/core';
import 'tinymce';
import 'tinymce/themes/modern';
import 'tinymce/plugins/table';
import 'tinymce/plugins/link';
import 'tinymce/plugins/paste';
import 'tinymce/plugins/lists';
import 'tinymce/plugins/advlist';
import 'tinymce/plugins/code';

declare let tinymce: any;

@Component({
  selector: 'app-tinymce',
  templateUrl: './tinymce.component.html',
  styleUrls: ['./tinymce.component.scss']
})
export class TinymceComponent implements AfterViewInit, OnDestroy {
  @Input() elementId: String;
  @Input() content: String;
  @Output() onEditorContentChange = new EventEmitter();

  editor;

  ngAfterViewInit() …
Run Code Online (Sandbox Code Playgroud)

data-binding tinymce angular

2
推荐指数
1
解决办法
2181
查看次数