标签: material

在TabBar下面添加阴影 - Material Design

我有一个操作栏和标签栏.我删除了动作栏下面的阴影

<item name="android:windowContentOverlay">@null</item>
Run Code Online (Sandbox Code Playgroud)

虽然,我想在标签栏下添加阴影.我正在使用SlidingTabLayout.我的标签TextView:

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tabText"
android:layout_width="wrap_content"
android:layout_height="@dimen/actionbar_height"
android:textColor="@color/tab_color"
android:gravity="center"
android:textAllCaps="true"
android:singleLine="true" />
Run Code Online (Sandbox Code Playgroud)

怎么做?

android material android-layout

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

如何更改角度材质md-主按钮文字颜色?

基本上我不能为我的生活弄清楚如何使用角度材料和其他任何使用md-primary背景颜色设置按钮的文本颜色.

我用来创建主题的代码是

var customPrimary = {
        '50': '#7de3cf',
        '100': '#69dec8',
        '200': '#54dac0',
        '300': '#3fd5b8',
        '400': '#2dceaf',
        '500': '#28b99d',
        '600': '#23a48b',
        '700': '#1f8f79',
        '800': '#1a7a68',
        '900': '#166556',
        'A100': '#92e8d7',
        'A200': '#a7ecdf',
        'A400': '#bcf1e7',
        'A700': '#115044'
    };
    $mdThemingProvider
        .definePalette('customPrimary',
        customPrimary);
    $mdThemingProvider.theme('buttons')
        .primaryPalette('customAccent');
Run Code Online (Sandbox Code Playgroud)

然而,无论我尝试什么,我都可以得到文本颜色,#fff除非我使用CSS和!important我想避免,因为它意味着重写几个选择器.

material angularjs angular-material

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

使用Material2 MdAutocomplete组件 - 如何使用onselect事件

我正在尝试使用新的自动完成组件for material2 beta.2我可以让组件和选项菜单渲染得很好,但是一旦从列表中选择一个选项,我就无法弄清楚如何执行操作

<md-input-container dividerColor="accent" [mdTooltip]="hint" mdTooltipPosition="above">
     <input mdInput [formControl]="selectedInput" [mdAutocomplete]="auto" placeholder="text">
</md-input-container>
<md-autocomplete #auto="mdAutocomplete">
     <md-option *ngFor="let option of filteredOptions | async" [value]="option">{{ option }}</md-option>
</md-autocomplete>
Run Code Online (Sandbox Code Playgroud)

我的最终目标是每次用户从列表中选择一个值时,可以填充一个名为selectedItems的变量,该变量位于我的组件中(可以多次选择).

我知道它与MdAutocompleteTrigger有关但我无法将这些碎片连接在一起.

material angular-material angular-material2 angular

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

Angular(4.xx)Material CheckBox组件(mat-checkbox):[checked]无效

怎么可能????

看到这个:

<div class="col-lg-1 check-field">
    <mat-checkbox color="primary"
                  [checked]="true"
                  formControlName="flagRimb">Rimb.
    </mat-checkbox>
</div>
Run Code Online (Sandbox Code Playgroud)

我已经把真正的价值放在了检查上,并且仍然没有看到在加载组件时检查了mat-checkbox !! 难以置信!!!

唯一可以扰乱行为的是formControl,它有:

     return this._formBuilder.group({
        [...],
        flagAdd : ['',Validators.required],
        [...]
    });
Run Code Online (Sandbox Code Playgroud)

formControlName就在那里,因为我需要设置相对于http rest调用给出的model.value的复选框值,但即使默认值设置为true也不行!

从控制台看来,生成的爆炸材料html不会从<_ <继承checked属性.

任何的想法?提前致谢!!

编辑1:已使用已检查INSTEAD [已选中]

在此输入图像描述

javascript forms checkbox material angular

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

如何始终在当前选择中独立地在mat-select中显示占位符

我希望mat-select元素始终显示占位符,即使选择了一个选项也是如此。

我的HTML代码:

<mat-select [formControlName]="'language'" placeholder="Language">
    <mat-option value="de">Deutsch</mat-option>
    <mat-option value="en">English</mat-option>
</mat-select>
Run Code Online (Sandbox Code Playgroud)

当前的行为是:一旦选择了一种语言,占位符就会变小,移到顶部,并且所选语言会显示大。

我要拥有的内容:选择一种语言后,仍应以大尺寸显示占位符,而不显示所选的语言。

我怎样才能做到这一点?

html javascript material angular

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

带有输入文件的Angular 4/5材料凸起按钮

我正在开发一个角度应用程序,目前正在上传我正在使用的文件:

<label class="btn btn-default">
    <input type="file" (change)="selectFile($event)">
</label>
<button class="btn btn-success" [disabled]="!selectedFiles"
    (click)="upload()">Upload</button>
Run Code Online (Sandbox Code Playgroud)

使用我的.ts文件中的方法,它运行良好.

我想将此升级为物质角度组件凸起按钮,就像现在一样:

<button mat-raised-button>
    <input type="file" (change)="selectFile($event)">
</button>

<button mat-button disabled [disabled]="!selectedFiles" (click)="upload()">Upload</button>
Run Code Online (Sandbox Code Playgroud)

禁用按钮运行良好,但输入文件部分不起作用,打印错误,不打开文件夹搜索窗口.有任何想法吗?

html material angular-material angular

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

Angular 6材质-色调和如何更改垫子单选按钮的颜色

如何更改使用CSS的颜色?

在另一篇文章中看到,如果我使用以下代码,它将对其进行更改,但是到目前为止我还没有运气。

.mat-radio-button.mat-accent .mat-radio-ripple .mat-ripple-element {
    background-color:rgb(255, 37, 37);
  }

.mat-radio-button.mat-accent.mat-radio-checked .mat-radio-outer-circle {
    border-color: rgb(66, 134, 244);
}

.mat-radio-button.mat-accent .mat-radio-inner-circle {
    background-color: rgb(66, 134, 244);
}
Run Code Online (Sandbox Code Playgroud)

另外,如何使用其余的色调?

<mat-radio-button color="accent">Hello, World</mat-radio-button>
Run Code Online (Sandbox Code Playgroud)

假设我要使用口音颜色(300或A100的色相),该怎么做?

我试过使用accent-100accent hue-100但是不起作用

css material angular

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

Flutter:应用程序的语言环境不受其所有本地化委托的支持

您好,我正在尝试在flutter应用程序中添加BottomNavigationBar,但是当我运行项目时发生错误:

A MaterialLocalizations delegate that supports the ka_GE locale was not found
Run Code Online (Sandbox Code Playgroud)

这是我的应用程序代表:

  supportedLocales: [
    const Locale('en', 'US'),
    const Locale('ka', 'GE'),
    const Locale('ru', 'RU'),
  ],
  localizationsDelegates: [
    const InfosLocalizationsDelegate(),
    GlobalMaterialLocalizations.delegate,
    GlobalWidgetsLocalizations.delegate
  ],
  locale: Locale('ka')
Run Code Online (Sandbox Code Playgroud)

这是Custom LocalizationsDelegate:

class CLocalizationsDelegate
    extends LocalizationsDelegate<CLocalizations> {
  const CLocalizationsDelegate();

  @override
  bool isSupported(Locale locale) =>
      ['en', 'ka', 'ru'].contains(locale.languageCode);

  @override
  Future<CLocalizations> load(Locale locale) async {
    CLocalizations localizations = new CLocalizations(locale);
    await localizations.load();
    print("Load ${locale.languageCode}");
    return localizations;
  }

  @override
  bool shouldReload(CLocalizationsDelegate old) => false;
}
Run Code Online (Sandbox Code Playgroud)

是的,我知道问题是“ ka”,因为MaterialLocalizations不支持该问题,但我必须解决该问题,所以你们可以帮我吗?

localization internationalization material dart flutter

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

以编程方式设置材料芯片的背景色

Chip chip = new Chip(context);
chip.setBackgroundcolor(getResources().getColor(R.color.blue));
Run Code Online (Sandbox Code Playgroud)

上面的行给出了错误:

java.lang.UnsupportedOperationException: Do not set the background resource; Chip manages its own background drawable.
Run Code Online (Sandbox Code Playgroud)

android material android-chips material-components-android

3
推荐指数
4
解决办法
3823
查看次数

添加Xamarin.Forms.Visual.Material nuget后无法构建XF Android项目

我有一个Xamarin Forms项目,现在我想通过新的Visual / Material功能对其进行改进。

在IOS上,它就像一种魅力。

在Android上,我有一个奇怪的问题:添加Xamarin.Forms.Visual.Material nuget后,我收到奇怪的错误消息,并且我的项目无法构建:

\res\values\values.xml(6): error APT0000: Attribute "statusBarBackground" already defined with incompatible format.
\res\values\values.xml(2): error APT0000: Original attribute defined here.
\res\values\values.xml(10): error APT0000: Attribute "layout_anchorGravity" already defined with incompatible format.
\res\values\values.xml(2): error APT0000: Original attribute defined here.
\res\values\values.xml(17): error APT0000: Attribute "layout_insetEdge" already defined with incompatible format.
\res\values\values.xml(2): error APT0000: Original attribute defined here.
\res\values\values.xml(17): error APT0000: Attribute "layout_dodgeInsetEdges" already defined with incompatible format.
\res\values\values.xml(2): error APT0000: Original attribute defined here.
\res\values\styles.xml(2): error APT0000: Error retrieving …
Run Code Online (Sandbox Code Playgroud)

android material xamarin.forms

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