button 相关问题

按钮是图形用户界面中的简单元素,可以将鼠标点击或手指点击(在移动设备上)作为输入。

我正在构建一些Primeng按钮,但对于我的项目来说太大了。我在文档中看到了我可以使用

但是当我使用这些按钮的其他属性时,我正在使用 <button> <p-button> 我尝试使用样式(宽度和高度),但是按钮内的文本不会改变其大小。有办法实现这一目标吗?我附加了按钮的代码:<span class="p-buttonset"> <button pButton pRipple label="Mapa" class="p-button-outlined p-button-secondary" style="background-color: rgba(255, 255, 255, .65); color:darkslategray ;" (click)="cambiarTipo(0)" ></button> <button pButton pRipple label="Satélite" class="p-button-outlined p-button-secondary" style="background-color: rgba(255, 255, 255, .65); color: darkslategray;" (click)="cambiarTipo(1)"></button> </span> &nbsp; <button pButton pRipple label="Zonas prohibidas" class="p-button-outlined p-button-secondary" style="background-color: rgba(255, 255, 255, .65); color:darkslategray ;" (click)="prohibidas()"></button> &nbsp;<button pButton pRipple label="Ver puntos" class="p-button-outlined p-button-secondary" style="background-color: rgba(255, 255, 255, .65); color:darkslategray ;" (click)="mostrarTabla()"> </button> &nbsp; <div class="p-inputgroup" > <p-inputNumber inputStyleClass="black" [(ngModel)]="tiempoIsocronas" mode="decimal" placeholder="Tiempo isocronas" [useGrouping]="false" [disabled]="lista.length!=1" [inputStyle]="{border:'1px solid darkslategray',background:'rgba(255, 255, 255, .65)'}"> </p-inputNumber> <button pButton pRipple type="button" icon="pi pi-search" class="p-button-outlined p-button-secondary" (click)="llamarServicio(listaMetodos.isocronas)" [disabled]="lista.length!=1" style="background-color: rgba(255, 255, 255, .65); color:darkslategray ;"> </button> </div> 使用此css :host ::ng-deep .p-button{ font-size:30px; //your font size here } 我经历了类似的问题。官方网站上的文档的答案https://primeng.org/theming推荐对我有用的内容,在您的主要CSS文件中: html{ font-size: <your desired font size> } 最初基于字体大小为16px,因此我个人使用了12个并喜欢它。但是,这将改变应用程序中所有组件的尺寸。如果您只想更改按钮的大小,则可以将它们隔离而不是用 .p-button{ font-size: <your desired font size> } Just Just wrap p.selectbutton在一个div内带有flex-column <div class"flex-column"> <p-selectbutton></p-selectbutton> </div>

回答 2 投票 0

bootstrap 4按钮组包装修复Border-Radius

我使用bootstrap 4.3.1如果有任何区别。 <div class="row mt-3"> <div class="col text-center"> <div id="alphabetGroup" class="btn-group flex-wrap" role="group"> <button id="btnHash" type="button" class="btn btn-outline-dark">#</button> <button id="btnA" type="button" class="btn btn-outline-dark">A</button> <button id="btnB" type="button" class="btn btn-outline-dark">B</button> <button id="btnC" type="button" class="btn btn-outline-dark">C</button> <button id="btnD" type="button" class="btn btn-outline-dark">D</button> <button id="btnE" type="button" class="btn btn-outline-dark">E</button> <button id="btnF" type="button" class="btn btn-outline-dark">F</button> <button id="btnG" type="button" class="btn btn-outline-dark">G</button> <button id="btnH" type="button" class="btn btn-outline-dark">H</button> <button id="btnI" type="button" class="btn btn-outline-dark">I</button> <button id="btnJ" type="button" class="btn btn-outline-dark">J</button> <button id="btnK" type="button" class="btn btn-outline-dark">K</button> <button id="btnL" type="button" class="btn btn-outline-dark">L</button> <button id="btnM" type="button" class="btn btn-outline-dark">M</button> <button id="btnN" type="button" class="btn btn-outline-dark">N</button> <button id="btnO" type="button" class="btn btn-outline-dark">O</button> <button id="btnP" type="button" class="btn btn-outline-dark">P</button> <button id="btnQ" type="button" class="btn btn-outline-dark">Q</button> <button id="btnR" type="button" class="btn btn-outline-dark">R</button> <button id="btnS" type="button" class="btn btn-outline-dark">S</button> <button id="btnT" type="button" class="btn btn-outline-dark">T</button> <button id="btnU" type="button" class="btn btn-outline-dark">U</button> <button id="btnV" type="button" class="btn btn-outline-dark">V</button> <button id="btnW" type="button" class="btn btn-outline-dark">W</button> <button id="btnX" type="button" class="btn btn-outline-dark">X</button> <button id="btnY" type="button" class="btn btn-outline-dark">Y</button> <button id="btnZ" type="button" class="btn btn-outline-dark">Z</button> </div> </div> </div> 当查看桌面或任何具有足够宽屏幕的设备时,看起来像这样: Alphabet按钮组 现在,当您进入较小的屏幕或移动设备时,它会包裹着,而是这样的: 包装按钮组 我对此的外观很好,但是我想改变一些东西: i可以使左上(第一个按钮)和底部右上方(最后一个按钮)具有适当的圆角,但是我该如何处理左下角和右上的按钮?根据窗口的宽度,按钮本身并不总是相同的,我不想强迫群体分裂(设置断点等多组等)。 您可以随身携带JSFIDDLE。由于某种原因,它不能像我自己的代码中那样证明按钮是合理的,但这并不重要 - 如果您使结果窗格变薄,则可以看到按钮组包装,左侧应用顶行证明是合理的。如果您可以使第一行具有边界底 - 拉迪乌斯(Left-Radius),那么也应该能够将类似的东西应用于右上。 https://jsfiddle.net/cglatot/yu6w4rkv/1/ #alphabetGroup button:first-child { border-radius: 8px 0 0 8px; } #alphabetGroup button:last-child { border-radius: 0 8px 8px 0; } trone这样的东西.. trone停用BTN边框并使用溢出容器。 #alphabetGroup { border-radius: .25rem; overflow: hidden; .btn { border-radius: none; } } 取决于您愿意妥协的事情,您可能必须在边境上四处摆弄。我通常会给容器一个左上的边框,按钮的右侧为右侧。

回答 1 投票 0

XLS0504属性'fontfamily'不支持类型'onplatform`1(t)'xamarin forms formsforms

我正在尝试在我的fontawsome项目中添加Xamarin forms图标。我关注的是本教程这样做。但是,当我使用以下代码时, <Button.FontFamily> <OnPlatform></OnPlatform> </Button.FontFamily> 它显示错误。那就是XLS0504 Property 'FontFamily' does not support values of type 'OnPlatform1(t)'.如何解决此错误? Xamarin Version - 5.0.0.2012 是因为您需要将fontfamily指定为字符串。 trone类似于以下内容: <Button.FontFamily> <OnPlatform x:TypeArguments="x:String"> <On Platform="iOS" Value="iOSFont" /> <On Platform="Android" Value="AndroidFont" /> <On Platform="UWP" Value="UWPFont" /> </OnPlatform> </Button.FontFamily>

回答 1 投票 0

如何在表格材料中的tablecell上添加按钮ui

IAM Build NextJS项目并从材料UI创建表,并从MongoDB获取数据。 我想在操作(编辑和删除)列上添加两个按钮,但不知道该如何在材料MUI上进行操作 ...

回答 2 投票 0

当您单击时,按钮没有特定的颜色。为什么?

我在悬停在按钮上以及活动按钮的颜色上时效果有问题。如何实施? 主要问题是,当您悬停在按钮上时,C ...

回答 1 投票 0


如何管理SyncfusionBlazor

因此,我有一个儿童按钮组件,该组件使用OnClick事件添加一类,然后在短时间后删除课程(用于按钮纹波效果)。我现在面临的问题是添加另一个

回答 1 投票 0

我如何在滑块开关中进行平稳的过渡?

<ToggleButton x:Name="toggleSwitch" Width="30" Height="18" Style="{StaticResource CustomToggleSwitch}"/> <Style TargetType="ToggleButton" x:Key="CustomToggleSwitch"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ToggleButton"> <StackPanel> <Border x:Name="BorderElement" CornerRadius="8" Width="28" Height="18"> <Border.Background> <SolidColorBrush Color="#252525"/> </Border.Background> <Border.BorderBrush> <SolidColorBrush Color="#333333"/> </Border.BorderBrush> <Border.BorderThickness> <Thickness>2</Thickness> </Border.BorderThickness> <Ellipse x:Name="SwitchEllipse" Fill="#848386" Width="10" Height="10" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2"> <Ellipse.RenderTransform> <TranslateTransform x:Name="EllipseTranslateTransform" /> </Ellipse.RenderTransform> </Ellipse> </Border> </StackPanel> <ControlTemplate.Triggers> <Trigger Property="IsChecked" Value="True"> <Setter TargetName="SwitchEllipse" Property="Fill" Value="#F5F1FF"/> <Setter TargetName="BorderElement" Property="Background" Value="#725DFF"/> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetName="EllipseTranslateTransform" Storyboard.TargetProperty="X" To="25" Duration="0:0:0.2"/> <!-- Движение вправо --> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> </Trigger> <Trigger Property="IsChecked" Value="False"> <Setter TargetName="SwitchEllipse" Property="Fill" Value="#848386"/> <Setter TargetName="BorderElement" Property="Background" Value="#252525"/> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetName="EllipseTranslateTransform" Storyboard.TargetProperty="X" To="0" Duration="0:0:0.2"/> <!-- Возвращение влево --> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>

回答 1 投票 0

按钮和下拉下拉使用相同的表演/隐藏jQuery,结果矛盾 - 如何调解问题

https://codepen.io/wammygiveaway/pen/vywrrwg 您正在看到的是用户Kurt创建的节目隐藏切换的jQuery版本,以响应用户1575698在切换多个ID时的问题。 ...

回答 1 投票 0

add类,当按钮在Blazor

@using System.Timers <button class="primary-btn @buttonClass" @onclick="AddRipple">Action 1</button> <button class="primary-btn @buttonClass" @onclick="AddRipple">Action 2</button>

回答 1 投票 0


我如何在CSS按钮中进行文本仅出现在悬停? [重复]

i在示例网站上制作了一些CSS DIV按钮,该按钮在侧边栏导航菜单中使用。我只是想知道如何制作它,以便只有在鼠标被霍夫时出现文本...

回答 5 投票 0

试图将数据发送到另一个片段,但是当我按下按钮时,它关闭了app

我正在尝试制作一个应用程序,以控制花园的各个方面。改变温度,湿度,风以及等。现在我从温度开始,我不了解我是什么

回答 1 投票 0

https://codepen.io/tomma5o/pen/zwykya

回答 2 投票 0

如何创建具有多个脉冲效果的按钮

因此,我想要一个按钮,例如3脉冲,例如3,但它们应该在300-400ms之间具有间隔,并且如果可以以某种方式达到这种扭曲效果 考试...

回答 1 投票 0


回答 1 投票 0

带有声板的按钮的曲折音频夹

https://editor.p5js.org/hvgrajciar/full/kion1sx6h 我有问题将这些音频文件与我的音板地图一起使用。我想将每个音频文件连接到...

回答 1 投票 0

如何在python/pygame中制作按钮? 我在pygame上制作游戏,在第一个屏幕上,我希望有一个按钮,您可以按(i)启动游戏,(ii)加载带有指令的新屏幕,(iii)退出程序。 我...

#load_image is used in most pygame programs for loading images def load_image(name, colorkey=None): fullname = os.path.join('data', name) try: image = pygame.image.load(fullname) except pygame.error, message: print 'Cannot load image:', fullname raise SystemExit, message image = image.convert() if colorkey is not None: if colorkey is -1: colorkey = image.get_at((0,0)) image.set_colorkey(colorkey, RLEACCEL) return image, image.get_rect() class Button(pygame.sprite.Sprite): """Class used to create a button, use setCords to set position of topleft corner. Method pressed() returns a boolean and should be called inside the input loop.""" def __init__(self): pygame.sprite.Sprite.__init__(self) self.image, self.rect = load_image('button.png', -1) def setCords(self,x,y): self.rect.topleft = x,y def pressed(self,mouse): if mouse[0] > self.rect.topleft[0]: if mouse[1] > self.rect.topleft[1]: if mouse[0] < self.rect.bottomright[0]: if mouse[1] < self.rect.bottomright[1]: return True else: return False else: return False else: return False else: return False def main(): button = Button() #Button class is created button.setCords(200,200) #Button is displayed at 200,200 while 1: for event in pygame.event.get(): if event.type == MOUSEBUTTONDOWN: mouse = pygame.mouse.get_pos() if button.pressed(mouse): #Button's pressed method is called print ('button hit') if __name__ == '__main__': main()

回答 6 投票 0


最新问题
© www.soinside.com 2019 - 2025. All rights reserved.