小编nsq*_*res的帖子

如何将 mat-button 与 mat-input 对齐?

我怎样才能让这两个项目正确对齐?我试图让它们完美对齐,但调整按钮高度只会使底部离搜索输入的底部更远。我认为这是因为它们的中心没有对齐,所以调整高度并不是真正的正确解决方案。 在此处输入图片说明

这是 HTML

<!-- Search Box and Button-->
    <p>Search by company name:</p>
    <mat-form-field appearance="outline"> 
        <mat-label>Search</mat-label>
        <input matInput placeholder="Search">
    </mat-form-field>

    <button mat-stroked-button color="primary">Search</button>
Run Code Online (Sandbox Code Playgroud)

这是 SCSS:

mat-form-field.mat-form-field {
    font-size: 12px;
    width: 300px;
  }

  button.mat-stroked-button {
    font-size: 14px;
    height: 42px;
    margin: 10px;
  }
Run Code Online (Sandbox Code Playgroud)

html css angular-material angular mat-input

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

如何根据 PySimple GUI 中的按钮点击显示不同的布局?(持久窗口循环)

我想知道是否有一种方法可以根据 PySimple GUI 中的按钮点击来管理不同的布局。我刚刚开始使用这个框架,我想找到导航菜单的最佳方式。不必使用不同的布局,但这只是让我想到了最直观的方式。

I was thinking like maybe having a list of layouts that get pushed to the top when a certain submenu button is selected.

layouts = [layout1, layout2, layout3, layout4]
Run Code Online (Sandbox Code Playgroud)

或者也许可以通过以下方式启动程序:

layout = layout1
Run Code Online (Sandbox Code Playgroud)

And when a submenu is selected just change the state to:

layout = layout2
Run Code Online (Sandbox Code Playgroud)

例如,有一个“主菜单”布局,在单击按钮时,将不同的布局或“子菜单”带到“前面”,以便整个程序在一个窗口中运行。也许看起来像这样:

主菜单

按钮 1

按钮 2

按钮 3

单击按钮 1 时,窗口保持打开状态,但显示更改为子菜单 1。

在 PySimpleGui Docs 中,我使用了推荐用于构建某些程序的持久窗口循环:

import PySimpleGUI as sg

sg.theme('BluePurple')

layout = [[sg.Text('Your typed chars appear here:'), sg.Text(size=(15,1), …
Run Code Online (Sandbox Code Playgroud)

python window persistent submenu pysimplegui

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

Is there a way to use a mat-autocomplete where the corresponding input is in its parent component?

This works with a regular datalist element where the list="target" on the input element can find the id="target" in the child component. I am trying to figure out a way to do this with the material autocomplete component.

Using a regular datalist element

parent.component.html

 <input type="text" list="target">
 <app-child></app-child>
Run Code Online (Sandbox Code Playgroud)

child.component.html

<datalist id="target">
    <option *ngFor="let option of options" [value]="option.name"></option>
</datalist>
Run Code Online (Sandbox Code Playgroud)

I have been trying to implement this feature all day I usually get one of two errors:

Error: Attempting to open an …
Run Code Online (Sandbox Code Playgroud)

autocomplete angular-material angular mat-autocomplete

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