material-design 相关问题

材料设计是Google针对Android 5.0 Lollipop引入的跨平台和设备的视觉,动作和交互设计指南。

如何在android studio中使用Material Design

如何在 Android Studio 中使用 Material Design 编写用于交互式 UI 的 xml 代码 要实施哪个材料设计库? 我尝试实现 Material Design 但失败了,xml 代码,同时运行......

回答 1 投票 0

具有多行的 MUI TextField - 关于缺少 id/name 的警告

我遇到这个问题,一旦我将“多行”添加到我的 Material UI (MUI) TextField,我的浏览器就会显示警告“表单字段元素应该有 id 或 name 属性”。它...

回答 1 投票 0

SASS HEX 到 RGB,不带“rgb”前缀

问题: 是否有 SASS 函数/技术可以将十六进制值转换为简单的 RGB 字符串。 这里简单意味着只是一个字符串而不将其包含在 rgb() 中? 例如:#D50000 --> ...

回答 3 投票 0

更改垫子自动完成宽度?

看起来宽度始终是我们输入的输入的宽度。有没有办法让它变大?我的输入非常小,无法读取下拉项目。我……

回答 7 投票 0

Material-ui 搜索图标需要位于输入框右侧

我想让搜索图标出现在material-ui(react)中输入框的右侧。是否需要为此添加任何类? 这是代码片段 从'@material-ui/

回答 2 投票 0

postSplashScreenTheme 在启动屏幕后不应用主题

按照Android文档(还有这个和这个)所示实现启动屏幕API后,启动活动(在启动屏幕之后立即进行)没有动态颜色主题

回答 1 投票 0

Angular Material 无法切换 Mat-SideNav

菜单 <mat-toolbar color="primary"> <mat-toolbar-row> <button mat-icon-button> <mat-icon (click)="sidenav.toggle()">menu</mat-icon> </button> <h1>{{applicationName}}</h1> <span class="menu-spacer"></span> <div> <a mat-button [routerLink]="'/create-account'"> Create Account </a> <a mat-button [routerLink]="'/contacts'"> Contact Us </a> <a mat-button [routerLink]="'/create-contact'"> Login </a> </div> </mat-toolbar-row> <mat-toolbar-row> <span style="font-size: 12px;">{{applicationName}} helps you!</span> </mat-toolbar-row> </mat-toolbar> <mat-sidenav-container> <mat-sidenav #sidenav> <mat-nav-list> <a mat-list-item [routerLink]="'/accounts'"> Accounts </a> <a mat-list-item [routerLink]="'/create-account'"> Create Account </a> <a mat-list-item [routerLink]="'/contacts'"> Contacts </a> <a mat-list-item [routerLink]="'/create-contact'"> Create Contact </a> <a mat-list-item [routerLink]="'/activities'"> Activities </a> <a mat-list-item [routerLink]="'/create-activity'"> Create Activity </a> <a mat-list-item (click)="sidenav.toggle()" href="" mat-list-item>Close</a> </mat-nav-list> </mat-sidenav> <mat-sidenav-content> <div style="height: 88vh;"> <router-outlet></router-outlet> </div> </mat-sidenav-content> </mat-sidenav-container> TypeScript 文件 import {Component, OnInit} from '@angular/core'; import {environment} from "../../../../environments/environment"; @Component({ selector: 'app-headerdefault', templateUrl: './default.component.html', styleUrls: ['./default.component.css'] }) export class HeaderDefaultComponent implements OnInit{ applicationName: string = "untitled" ngOnInit() { this.applicationName = environment.applicationName; } } 当我单击切换时,似乎什么也没发生。 我正在使用 Angular 16 和 Angular Material 项目链接 https://www.dropbox.com/scl/fi/c42oz76nnqjzwuvzhw81k/banking-frontend.zip?rlkey=9jetvayqchlpbhkuy61wkl9e5&dl=0 将点击处理程序放在 <button> 上,而不是 <mat-icon>: <button mat-icon-button (click)="sidenav.toggle()"> <mat-icon>menu</mat-icon> </button>

回答 1 投票 0

如何在jetpack compose中实现这种定向淡入?

这似乎是 2 个合成视图重叠,而不是 1 个从左上角方向淡出。 jetpack compose 中如何实现定向淡入淡出?

回答 1 投票 0

使用flutter制作扩展FAB(FloatingActionButton)流体宽度

有没有办法像Material 3规范中描述的那样使用颤振来制作扩展的FAB流体宽度? 尝试使用合适的盒子: 返回容器( 宽度:双无穷大, 颜色:

回答 1 投票 0

如何更改Flutter Material 3 DatePicker的主色?

我正在使用 showDatePicker() 在我的 Flutter 应用程序中显示日期选择器。 如何改变紫色? 到目前为止,这是我的主题: 日期选择器主题数据( 背景颜色: Color.fromARGB(255, 38...

回答 2 投票 0

Android - 单击撰写 ListItem 并获取对其内容的引用

在非撰写版本中,我有类似以下内容: (...) 在非撰写版本中,我有类似以下内容: (...) <LinearLayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="wrap_content"> <com.google.android.material.textview.MaterialTextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="my label"/> <com.google.android.material.textview.MaterialTextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="my text"/> </LinearLayout> (...) 并且它会根据需要重复多次,用各自的文本表示值列表,例如: 用户设置 活跃 服务器已连接 www.someserver.com 调试信息 u5y4t3fweryhjy43tr2 等等 我有一个辅助函数,只要单击 container 就会运行,迭代相应容器的所有子视图,并从 TextView 的任何视图收集所有文本。 这可以帮助用户通过单击复制特定部分内的所有文本以进行调试。 但是,在使用 compose 时我很难复制这种机制。 我已经用纯compose重新创建了上面的布局,例如: (...) ListItem( modifier = Modifier.clickable { // no way to get headlineContent and supportingContent here }, headlineContent = { Text(text = stringResource(id = R.string.my_label)) }, supportingContent = { Text(text = stringResource(id = R.string.my_text)) }, ) (...) 但是,当涉及到实现 onclick 机制来迭代容器的所有子级,并从任何 Text 中提取文本时,我找不到实现此目的的方法。 我已经使用了Modifier.clickable {},但没有提及ListItem,或其中的任何孩子。 其中许多内容是动态的,但标签本身是静态的,因此辅助函数显着简化了此过程,因为我不再需要为每个容器手动编码每个单击操作,从而考虑到可以动态更改的文本. 这是否不可能像 kotlin 那样通过 compose 来实现?如果是的话,该怎么办? 您可以创建另一个函数来提供您想要的 API 界面: @Composable fun ListItem( headlineId: @StringRes Int, supportingId: @StringRes Int, onClick: (headlineText: String, supportingText: String) -> Unit ) { val headlineText = stringResource(headlineId) val supportingText = stringResource(supportingId) ListItem( modifier = Modifier.clickable { onClick(headelineText, supportingText) }, headlineContent = { Text(text = headlineText) }, supportingContent = { Text(text = supportingText) } ) } 然后您可以使用: ListItem(R.string.my_label, R.string.my_text) { headlineText, supportingText -> // Now you can access the text of each } 当然,如果您的 onClick 侦听器想要的话,您可以将资源 ID 而不是字符串传递给您的侦听器 - 您可以控制要公开的抽象级别。

回答 1 投票 0

Android - 在 Compose with Material 3 中创建自定义颜色

我第一次探索 Compose + Material 3,在尝试实现自定义颜色时遇到了很大的困难。 我的意思是根据事情的发生方式执行以下操作...

回答 1 投票 0

如何更改Light and Dark Material 3 Jetpack compose中的StatusBar颜色?

我提供了自己的颜色来更改应用程序中的状态栏颜色,但它在 Material 3 中不起作用。 以下是 Theme.kt 文件中默认的浅色和深色: 私人 val DarkColorScheme = darkColorScheme...

回答 1 投票 0

如何更改 JetpackCompose 应用程序中的状态栏和导航栏颜色?

我想更改我的应用程序中的状态栏和导航栏颜色,默认情况下未设置。 这是我必须更改的可组合 AppTheme 函数。 val 视图 = LocalView.current 如果(!v...

回答 1 投票 0

Angular 15 Material 对齐输入字段中的文本以匹配选择字段

在搜索组件中,我有两个 mat-form-fields,一个是选择字段,另一个是文本输入字段。 当在两个字段中输入文本时,输入文本字段的文本未对齐

回答 1 投票 0

如何在 Material-UI (React) 中设置卡片高度的动画

我是 React 和 Material UI 新手,所以请耐心等待:P 我想做的是,有一张卡片可以随着内容的变化动态改变高度。根据文档,这应该发生

回答 4 投票 0

如何让Flutter的Material Design 3 FAB像Material Design 2一样圆?

我尝试的代码是以下代码。 浮动操作按钮( onPressed: () {}, 背景颜色:颜色.透明, 海拔:0, 子项:容器( 装饰...

回答 1 投票 0

使用 ScrollableTabRow 指示器显示选定的选项卡文本 - 意外行为

您可能已经知道,ScrollableTabRow 组件有一个名为“Indicator”的输入参数 当我使用此参数在所选项目周围绘制一个框时,输出与我的不同

回答 1 投票 0

底页对话框横向宽度问题

bottom_sheet_image_dialog.xml: bottom_sheet_image_dialog.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" app:behavior_hideable="false" app:behavior_peekHeight="62dp" app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:id="@+id/llAddDriverPic" android:background="?android:attr/selectableItemBackground" android:padding="8dp"> <ImageView android:layout_width="24dp" android:layout_height="24dp" android:src="@drawable/baseline_add_photo_alternate_24" android:layout_margin="8dp"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/add_picture" android:layout_gravity="center_vertical" android:padding="8dp"/> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:id="@+id/llRemoveDriverPic" android:background="?android:attr/selectableItemBackground" android:padding="8dp"> <ImageView android:layout_width="24dp" android:layout_height="24dp" android:src="@drawable/baseline_no_photography_24" android:layout_margin="8dp"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/remove_picture" android:layout_gravity="center_vertical" android:padding="8dp"/> </LinearLayout> 代码实现: BottomSheetDialog bsDialog = new BottomSheetDialog(getContext()); bsDialog.setContentView(R.layout.bottom_sheet_image_dialog); bsDialog.setOnShowListener(dialog -> { BottomSheetBehavior bottomSheetBehavior = ((BottomSheetDialog)dialog).getBehavior(); bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); }); 发生以下问题:视频中看到的宽度不会完全显示。 如果我在横向模式下从一开始就启动底页,宽度看起来也会不同,因为左侧和右侧没有被覆盖: 问题可能是什么? 显示对话框之前是否需要预先定义宽度? -> 你的xml布局没有问题,可以用代码解决。我在下面提供了一个解决此问题的示例。 => 底表类代码 public class BottomSheet extends BottomSheetDialogFragment { private View view; private BottomSheetBehavior mBottomBehavior; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { view = inflater.inflate(R.layout.bottom_sheet_layout, container, false); //Do your logic code here return view; } @Override public void onStart() { super.onStart(); mBottomBehavior = BottomSheetBehavior.from((View) view.getParent()); mBottomBehavior.setMaxWidth(ViewGroup.LayoutParams.MATCH_PARENT); mBottomBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); } } => 活动类别代码 Button button = findViewById(R.id.button); button.setOnClickListener(v -> { //To open the bottom sheet, NB. make sure 'BottomSheet' is the name you declared Bottom sheet class BottomSheet bottomSheet = new BottomSheet(); bottomSheet.show(getSupportFragmentManager(), "exampleBottomSheet"); }); 在科特林中: val dialog = BottomSheetDialog(context).apply { setContentView(bottomSheet.root) behavior.maxWidth = ViewGroup.LayoutParams.MATCH_PARENT behavior.state = BottomSheetBehavior.STATE_EXPANDED }

回答 2 投票 0

反应原生纸张按钮背景颜色

我从 https://callstack.github.io/react-native-paper/button.html 有这个按钮 报名 它没有背景颜色(正是我想要的)...

回答 5 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.