小编jrq*_*ick的帖子

如何从离子4 / Angular7中的@ViewChild获取nativeElement?

我正在像这样使用Ionic 4的离子搜索:

     <ion-searchbar
            #searchbarElem
            (ionInput)="getItems($event)"
            (tap)="handleTap($event)"
            [(ngModel)]="keyword"
            (ngModelChange)="updateModel()"
            [cancelButtonText]="options.cancelButtonText == null ? defaultOpts.cancelButtonText : options.cancelButtonText"
            [showCancelButton]="options.showCancelButton == null ? defaultOpts.showCancelButton : options.showCancelButton"
            [debounce]="options.debounce == null ? defaultOpts.debounce : options.debounce"
            [placeholder]="options.placeholder == null ? defaultOpts.placeholder : options.placeholder"
            [autocomplete]="options.autocomplete == null ? defaultOpts.autocomplete : options.autocomplete"
            [autocorrect]="options.autocorrect == null ? defaultOpts.autocorrect : options.autocorrect"
            [spellcheck]="options.spellcheck == null ? defaultOpts.spellcheck : options.spellcheck"
            [type]="options.type == null ? defaultOpts.type : options.type"
            [disabled]="disabled"
            [ngClass]="{'hidden': useIonInput}"
            (ionClear)="clearValue(true)"
            (ionFocus)="onFocus()"
            (ionBlur)="onBlur()"
    >
    </ion-searchbar>
Run Code Online (Sandbox Code Playgroud)

单击时,我从组件内部运行以下命令:

@HostListener('document:click', ['$event'])
private documentClickHandler(event) {
    if ((this.searchbarElem …
Run Code Online (Sandbox Code Playgroud)

ionic-framework angular ionic4 angular7

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

replaceFirst不起作用,但替换工作完全相同的输入?

我正在编写一个程序,其中一部分需要替换部分字符串而不删除重复项,因此我使用的replaceFirst()无法正常工作.

INPUT:

lock: "O_2_^-^"
str:  " O_2_^-^ " 
Run Code Online (Sandbox Code Playgroud)

码:

System.out.println(str);
System.out.println(lock);
System.out.println(str.contains(lock));
str = str.replaceFirst(lock, "");
System.out.println(str);
Run Code Online (Sandbox Code Playgroud)

OUTPUT:

 O_2_^-^ 
O_2_^-^
true
 O_2_^-^ 
Run Code Online (Sandbox Code Playgroud)

以上是我程序的实际输出.虽然replace()方法对我目前的情况不起作用,但我测试了它并且输出完全不同,正确无误.

INPUT:

lock: "O_2_^-^"
str:  " O_2_^-^ " 
Run Code Online (Sandbox Code Playgroud)

码:

System.out.println(str);
System.out.println(lock);
System.out.println(str.contains(lock));
str = str.replace(lock, "");
System.out.println(str);
Run Code Online (Sandbox Code Playgroud)

OUTPUT:

 O_2_^-^ 
O_2_^-^
true
  //empty line of output because string was detected and removed.
Run Code Online (Sandbox Code Playgroud)

我已经尝试过编写自己的replaceFirst()方法之外的所有内容,如果有人有任何建议或输入那么好.谢谢!

java regex string

3
推荐指数
2
解决办法
3725
查看次数

正则表达式找到小于x次且大于y次的字符连续?

我试图找到连续出现多次且连续少于23次的空格.我只需要它来找到.什么是正则表达式?

我想要\ s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s(< - 22次)与\ s\s\s\s一起找到,但我从来没有想要找到一个空格,也不想超过22个空格.

regex

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

如何将 Fat Free PHP 变量输出为 HTML?

我试图从包含 HTML 的 F3 输出一个变量。

$message = "<p>Hello, <b>World</b></p>"
Run Code Online (Sandbox Code Playgroud)

我输出如下:

<div class="container">
    {{ @message }}
</div>
Run Code Online (Sandbox Code Playgroud)

问题是它完全像这样显示:

"<p>Hello, <b>World</b></p>"
Run Code Online (Sandbox Code Playgroud)

而不仅仅是:

你好,世界

html php fat-free-framework

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

在Android中,是否可以设置drawable的边距?

我想这样做,所以我可以在动画列表中更改边距.

这会使按钮更靠近或远离屏幕边缘.

xml animation android margin

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

HTML/CSS:图像/ div没有出现在Mozilla中但是在IE中?

无法弄清楚为什么在IE中只显示div容器时图像没有出现Mozilla.有人知道任何解决方案吗?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Featured</title>
</head> 
<body>
<!--#include virtual="/header.html" -->
<!--#include virtual="/alpha.html" -->
<div id="WhiteBody">
    <center>
        <p class="HeaderFont">FEATURED</p>
    </center>
    <div style=background-color:#D9BA26; height:480px; width:320px; >
        <img src="images/Magic Hat #9.jpg" style=width:100%;height:100%; />
    </div>
</div>
<!--#include virtual="/alpha.html" -->
<!--#include virtual="/footer.html" -->
</body>
</html> 
Run Code Online (Sandbox Code Playgroud)

html css

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

Fat Free PHP:如何重复一个整数?

使用 Fat Free PHP 我试图重复一个 int 值:

<repeat group="{{ @totalIterations }}" value="{{ @i }}">
     {{ @i }}<br/>
</repeat>
Run Code Online (Sandbox Code Playgroud)

但它不起作用,我想要的结果是这样的:

for ($i = 0; $i < $totalIterations; $i++) {
     {{ @i }}<br/>
}
Run Code Online (Sandbox Code Playgroud)

php fat-free-framework

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

HTML/CSS:图像没有出现在Web浏览器中,只是空div?

可能重复:
HTML/CSS:图像/ div没有出现在Mozilla中但是在IE中?

我正在使用Dreamweaver并且图像显示在那里但是一旦我将页面和图像上传到服务器,所有显示的都是空div.

我已经尝试删除'.jpq',我已经从图像名称中删除了空格,但是当通过互联网上传时仍然没有图像显示.

<div style="background-color:#D9BA26; height:480px; width:320px;" >
        <img src="images/Magic Hat #9.jpg" style="width:100%;height:100%;" />
</div>
Run Code Online (Sandbox Code Playgroud)

html css

0
推荐指数
2
解决办法
99
查看次数