material-design

How can I dynamically load an icon using its snake_case name (React, material-ui)

核能气质少年 提交于 2020-02-01 09:13:07
问题 Normally I'd use material-ui icons by importing them directly per the material-ui instructions. But I have a text tag, which is the actual icon name (like calendar_view_day ) and need to get and render an icon component from it dynamically. How can I something like: render() { return ( <Icon name="calendar_view_day" color="primary" /> ) } Instead of: render() { return ( <CalendarViewDay color="primary" /> // Imported by name ) } 回答1: OK, so I massively overthought this. Correct answer Turns

How can I dynamically load an icon using its snake_case name (React, material-ui)

女生的网名这么多〃 提交于 2020-02-01 09:12:30
问题 Normally I'd use material-ui icons by importing them directly per the material-ui instructions. But I have a text tag, which is the actual icon name (like calendar_view_day ) and need to get and render an icon component from it dynamically. How can I something like: render() { return ( <Icon name="calendar_view_day" color="primary" /> ) } Instead of: render() { return ( <CalendarViewDay color="primary" /> // Imported by name ) } 回答1: OK, so I massively overthought this. Correct answer Turns

Input number in Angular Material Design?

非 Y 不嫁゛ 提交于 2020-01-31 07:59:24
问题 There is the standard input as: <input type="number" placeholder="Hours"> Is there something in Angular Material Design? I use Angular latest version I tried this, but it is just simple input: <md-input-container> <input mdInput type="number" placeholder="Favorite food" value="Sushi"> </md-input-container> It should be < md-input-container input="number"> ? ot input type="number"> ? 回答1: In short, yes. You want < md-input-container > wrapper which supports the following input types date

android:Theme.Material.Light requires API level 21 (current min is 8)

旧城冷巷雨未停 提交于 2020-01-30 14:29:29
问题 I want to use Material Theme in my application which has minimum sdk version of 8. As per docs - "The material theme is only available in Android 5.0 (API level 21) and above. The v7 Support Libraries provide themes with material design styles for some widgets and support for customizing the color palette." Does it mean I can use it if I add v7 Support Libarary in my project? Because after adding this library I got the following error: android:Theme.Material.Light requires API level 21

How do I reduce the padding between the text hint and text line?

不羁岁月 提交于 2020-01-30 08:51:08
问题 I have a TextInputEditText with a hint shown. I really do not like the amount of space between the hint and text line. I have tried setting the gravity to bottom but no luck. <com.google.android.material.textfield.TextInputEditText android:layout_width="400dp" android:layout_height="wrap_content" android:background="@android:color/white" android:inputType="textNoSuggestions" android:hint="@string/email_hint" android:textColorHint="@color/color_hint_grey" android:fontFamily="@font/alternate

flex not working to make design responsive

99封情书 提交于 2020-01-25 07:27:06
问题 I am using React Material components in my application, to make it responsive to various screen sizes i am trying to use flex . Below is my code <div style={{ display: 'flex', flexWrap: 'wrap', flexWrap: "wrap" }}> <div style={{ flexGrow: 1, flexBasis: "25%" }}> <Chip /> </div> <div style={{ flexGrow: 1, flexBasis: "25%" }}> <Chip /> </div> <div style={{ flexGrow: 1, flexBasis: "25%" }}> <Chip /> </div> <div style={{ flexGrow: 1, flexBasis: "25%" }}> <Chip /> </div> </div> In the above code

Angular Material tool-tip with HTML support

感情迁移 提交于 2020-01-25 07:20:07
问题 I just want to know that, Is there any good third party angular material tool-tip plugin with the support of HTML ? I am using Material design with Angular 7 only(no bootstrap) Although I am using ng2-tooltip-directive and it full fill's all my needs but it has some issues related to positioning of tool-tip on different browsers. Any other suggestions as HTML is not supported in angular material tooltips and for now, they don't have intentions to support it either 回答1: I have used SAT Popover

iOS: animating placeholder like material design textfield placeholder

荒凉一梦 提交于 2020-01-25 06:38:30
问题 I'm trying to make a textField that behaves just like the Material design MDCTextField . Everything is working well, but the animation of the placeholder is a bit buggy. The placeholder is going above the textField on editingDidBegin . But when returning the textField to its position on editingDidEnd , it is going below the textField then centered in the textField . What I want is to go back to the center of the textField without going below it. Knowing that the Placeholder is a UILabel. Here

Typing in TextField doesn't make label float

被刻印的时光 ゝ 提交于 2020-01-25 06:09:51
问题 I have made a form with Material Design components. My TextField floating labels float when AutoFill fills the inputs, but not when a user types in them. function fillFields() { $("#passwordTextField").val("test"); $("#usernameTextField").val("test"); } p.highlight-red-on-error { transition: color 180ms cubic-bezier(0.4, 0, 0.2, 1); } div.mdc-text-field--invalid~p.highlight-red-on-error { color: #b00020; } <head> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha256

Typing in TextField doesn't make label float

徘徊边缘 提交于 2020-01-25 06:08:44
问题 I have made a form with Material Design components. My TextField floating labels float when AutoFill fills the inputs, but not when a user types in them. function fillFields() { $("#passwordTextField").val("test"); $("#usernameTextField").val("test"); } p.highlight-red-on-error { transition: color 180ms cubic-bezier(0.4, 0, 0.2, 1); } div.mdc-text-field--invalid~p.highlight-red-on-error { color: #b00020; } <head> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha256