标签: material

使用CardView和浮动操作按钮Android创建布局

我想使用Material CardView和Custom Floating Action Button创建类似于以下图像的布局:在此输入图像描述

我开发了这个Layout xml文件,如下所示:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:fab="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <RelativeLayout
        android:id="@+id/mainview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <android.support.v7.widget.CardView
            android:id="@+id/cv"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardCornerRadius="2dp"
            app:cardElevation="2dp"
            android:layout_marginBottom="@dimen/cardMarginVertical"
            android:layout_marginLeft="@dimen/cardMarginHorizontal"
            android:layout_marginRight="@dimen/cardMarginHorizontal"
            android:layout_marginTop="@dimen/cardMarginVertical"
            app:cardPreventCornerOverlap="false"
            app:contentPadding="0dp">

            <com.github.florent37.materialviewpager.sample.ExpandableTextView
                android:id="@+id/expandingTextView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="15dp"
                android:layout_marginLeft="10dp"
                android:layout_marginTop="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginBottom="10dp"
                android:text="@string/longText" />

            <RelativeLayout
                android:id="@+id/buttonlayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/expandingTextView"
                android:layout_gravity="bottom"
                android:background="@android:color/transparent">

                <com.getbase.floatingactionbutton.FloatingActionButton
                    android:id="@+id/action_c"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    fab:fab_colorNormal="#fff"
                    android:layout_alignParentRight="true"
                    fab:fab_colorPressed="#fff"
                    android:visibility="visible" />
            </RelativeLayout>
        </android.support.v7.widget.CardView>
    </RelativeLayout>
</FrameLayout>
Run Code Online (Sandbox Code Playgroud)

android material android-layout material-design

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

如何在react的材料-ui中获取密码字段值

我无法访问的值<TextField />,如果我不写,<input type='password'/>那么它工作正常,但为此我得到一个TypeError,' this.refs [this._getRef(...)].getInputNode不是一个函数 ".

 dialogAction(tag,e){

  console.log(this.refs.password);
  console.log(this.refs.password.getValue());
  this.refs.dialog.dismiss();
}

render(){
let self = this;

let row = this.row,col = this.column;
let standardActions = [
  { text: 'Cancel',onTouchTap: this.dialogAction.bind(this,ProductConstants.CANCEL)},
  { text: 'Submit',onTouchTap: this.dialogAction.bind(this,ProductConstants.SUBMIT)}
];

return (
  <div className="ProductRepository">

    <Dialog ref = 'dialog'
      title="Dialog With Standard Actions"
      actions={standardActions}
      actionFocus="submit"
      modal={true}>
      <TextField ref='password'
        hintText="Password"
        floatingLabelText="Password">
        <input type="password" />
      </TextField>
    </Dialog>
    </div> 
    );}

   }
Run Code Online (Sandbox Code Playgroud)

下图是上述代码的控制台输出.

控制台输出

javascript material reactjs

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

如何导入3D场景(带.mtl文件的.obj文件)

我买了一个房间的3D模型.该模型采用的.obj格式.现在,我正在尝试将此模型导入Unity3D.

该模型带有:

  • 5x .obj档案
  • 5x .mtl档案
  • nx .jpg档案
  • nx .tga档案

The .mtl files contained paths that do not exist on my PC. So I removed the paths. The images files (.jpg & .mtl) are in the same directory as the .obj files. When I tried to import the .obj files, the room has no material on it. I then tried to use the FBX converter (with "Embed media" …

import unity-game-engine material fbx

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

谷歌素材图标(字体)不会在mozilla Firefox中呈现

我正在尝试使用WAMP将google material-icons添加到我当前在localhost上的本地WordPress项目中.使用CDN,一切都很完美,但我想要一个静态的图标参考.

这是我的目录结构

/
-index.php
-css/
----style.min.css
----MaterialIcons-Regular.eot
----MaterialIcons-Regular.ttf
----MaterialIcons-Regular.woff
----MaterialIcons-Regular.woff2
Run Code Online (Sandbox Code Playgroud)

style.min.css我有:

.material-icons{
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;  /* Preferred icon size */
  display: inline-block;
  width: 1em;
  height: 1em;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;

  /* Support for all WebKit browsers. */
  -webkit-font-smoothing: antialiased;
  /* Support for Safari and Chrome. */
  text-rendering: optimizeLegibility;

  /* Support for Firefox. */
  -moz-osx-font-smoothing: grayscale;

  /* Support for IE. */
  font-feature-settings: …
Run Code Online (Sandbox Code Playgroud)

css wordpress firefox font-face material

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

MTL文件中的KE属性

我的.obj文件旁边有一个.mtl文件,它指定了对象的材质.我试图创建一个解析器但不知道"Ke"属性的含义.例如:

Ka 0.78 0.78 0.78 
Kd 0.78 0.78 0.78
Ks 0 0 0
Ke 17 12 4 # What does this line mean?
Run Code Online (Sandbox Code Playgroud)

谢谢 :)

3d wavefront material .obj

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

我想将md-datepicker的设置格式设置为dd-mm-yyyy

角度材料的datepicker.我想保持日期选择器的更改格式为dd-mm-yyyy.

angular.module('MyApp')
.controller('AppCtrl', function($scope) {
  $scope.myDate = new Date();

  $scope.minDate = new Date(
    $scope.myDate.getFullYear(),
    $scope.myDate.getMonth() - 2,
    $scope.myDate.getDate());

  $scope.maxDate = new Date(
    $scope.myDate.getFullYear(),
    $scope.myDate.getMonth() + 2,
    $scope.myDate.getDate());    }).config(function($mdDateLocaleProvider) {
    $mdDateLocaleProvider.formatDate = function(date) {
return moment(date).format('YYYY-MM-DD');
};
});
Run Code Online (Sandbox Code Playgroud)

但我希望在应用程序中为所有日期选择器进行一次配置.我认为这个例子是针对单日期选择器的.

material angularjs

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

带有角度材料的.Net Core 2 Spa模板

试图让Angular Material或任何第三方控制集真正地使用这个新模板而苦苦挣扎.在这个新模板中,webpack分为TreeShakable和NonTreeShakable.此外,app.module现在是app.module.shared,app.module.browser,app.module.server.

由于我试图使其工作,应用程序将仅使用app.module.browser中配置的模块运行,但材料标签未得到处理.尝试简单的东西并尝试按钮.我没有收到任何错误,但没有错误.我在Plunker中找到了他们的例子,复制了它生成的内容,它显示正确告诉我,我至少得到了正确的CSS.

包括webpack供应商配置作为起点,因为这似乎是关键因为它如何捆绑css和js.

TIA

Webpack.vendor
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const merge = require('webpack-merge');
const treeShakableModules = [
    '@angular/animations',
    '@angular/common',
    '@angular/compiler',
    '@angular/core',
    '@angular/forms',
    '@angular/http',
    '@angular/platform-browser',
    '@angular/platform-browser-dynamic',
    '@angular/router',
    '@angular/material',
    '@angular/cdk',
    'zone.js'

];
const nonTreeShakableModules = [
    'bootstrap',
    'jqwidgets-framework',
    "@angular/material/prebuilt-themes/indigo-pink.css",
    'bootstrap/dist/css/bootstrap.css',
    'font-awesome/css/font-awesome.css',
    'es6-promise',
    'es6-shim',
    'event-source-polyfill',
    'jquery',
];
const allModules = treeShakableModules.concat(nonTreeShakableModules);

module.exports = (env) => {
    const extractCSS = new ExtractTextPlugin('vendor.css');
    const isDevBuild = !(env && env.prod);
    const sharedConfig = {
        stats: { modules: …
Run Code Online (Sandbox Code Playgroud)

asp.net material single-page-application angular

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

我应该为Angular 6应用程序使用Angular Material还是Bootstrap Material?

我决定使用Material Design创建一个新的Angular 6应用程序。问题是要使用哪个材料库?

如我所见,其他Bootstrap材质库都有自己的Angular版本,以避免使用JQuery。(https://mdbootstrap.com/angular/

为什么需要避免这种情况?是越野车还是很难开发?

MDBootstrap for Angular有免费和付费版本。我不喜欢免费版本,不能使用付费版本。

我真的应该在新的Angular应用中将Material Design for Bootstrap与JQuery一起使用吗?

material angular-material bootstrap-4 bootstrap-material-design angular

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

materialize-css和material UI之间的区别

我浏览了materializecssmaterialUI的主页。第一个提到基于Material Design的现代响应式前端框架,第二个提到实现Google的Material Design的React组件。他们两个都实现了材料设计,并且都给了我使用的组件。两者之间的区别到底在哪里?

material materialize reactjs material-design

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

为Android中的芯片设置边框颜色

在我的Android应用中,我有一个看起来像这样的简单芯片。

在此处输入图片说明

有没有办法设置边框的颜色使其像这样?

在此处输入图片说明

更新:我尝试添加形状,但在布局夸大期间出现异常

 <android.support.design.chip.Chip
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:background="@drawable/chip_with_border"
     android:text="my chip" />
Run Code Online (Sandbox Code Playgroud)

drawable/chip_with_border.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="rectangle">
            <solid android:color="#FFFFFF"/>
            <corners android:radius="30dp"/>
            <stroke android:width="1dp" android:color="#DDDDDD"/>
        </shape>
    </item>
</selector>
Run Code Online (Sandbox Code Playgroud)

这导致异常

android.view.InflateException:二进制XML文件第32行:错误膨胀了类android.support.design.chip.Chip

android material android-chips material-components material-components-android

6
推荐指数
2
解决办法
1126
查看次数