小编AKr*_*h95的帖子

具有独立滚动列的材质 UI 网格

我希望在 React 中使用 Material UI 制作多个滚动列。我有一种在引导程序中使用 flex 进行的方法,但我无法将其翻译过来。我已经整理了一个 hacky 方法的演示,它需要知道您要滚动的内容的大小(在本例中为 AppBar)

https://codesandbox.io/s/pmly895mm

html,
body {
  margin: 0;
  height: 100%;
}

#root {
  height: 100%;
}

.grid-container {
  height: calc(100% - 64px);
}

.grid-column {
  height: 100%;
  overflow-y: auto;
}
Run Code Online (Sandbox Code Playgroud)

在这个演示中,我将所有的高度设置为 100%(html、body、#root),然后创建了两个grid-container高度为 100% 的类 - AppBar 高度和grid-column高度为 100% 并且溢出-y 为 auto。

在 Bootstrap 中,我会将这些类分别应用于rowcolumn元素

.flex-section {
  flex-grow: 1;

  display: flex;
  flex-direction: column;

  min-height: 0;
}

.flex-col-scroll {
  flex-grow: 1;

  overflow: auto;

  min-height: 100%; …
Run Code Online (Sandbox Code Playgroud)

html css reactjs material-ui

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

使用自定义用户对象时的 Spring 会话 Redis

我正在按照本教程将 spring 会话(通过 redis)添加到我的应用程序中。http://www.baeldung.com/spring-session

我添加依赖项

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.session</groupId>
    <artifactId>spring-session</artifactId>
</dependency>
Run Code Online (Sandbox Code Playgroud)

和 SessionConfig.java 类

@Configuration
@EnableRedisHttpSession
public class SessionConfig extends AbstractHttpSessionApplicationInitializer {
}
Run Code Online (Sandbox Code Playgroud)

我已经在一个空白项目中完成了此操作,并且效果很好。但我当前的项目有一些带有自定义 UserDetailsS​​ervice 的自定义用户对象,这就是出现问题的地方。

Sat Apr 07 11:21:49 EDT 2018
There was an unexpected error (type=Internal Server Error, status=500).
Cannot serialize; nested exception is org.springframework.core.serializer.support.SerializationFailedException: Failed to serialize object using DefaultSerializer; nested exception is java.io.NotSerializableException: com.kreyzon.dollar.entity.User
Run Code Online (Sandbox Code Playgroud)

现在,我环顾四周并找到了实现此目的的建议:

@Bean
public RedisTemplate<Object, Object> sessionRedisTemplate (
        RedisConnectionFactory connectionFactory) {
    RedisTemplate<Object, Object> template = new RedisTemplate<Object, Object>();
    template.setKeySerializer(new StringRedisSerializer()); …
Run Code Online (Sandbox Code Playgroud)

java spring redis spring-boot spring-session

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

使卡片(或纸)不占用全宽材料 UI

我正在尝试创建一个不跨越它所在容器的整个宽度的卡片元素。

示例似乎能够做得很好

在此处输入图片说明

但是当我尝试使用示例代码时,我的卡片会拉伸页面的整个宽度。

https://codesandbox.io/s/074zmkx0

在此处输入图片说明

reactjs material-ui

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

删除显然不需要的垂直滚动条

我无法弄清楚如何从这个网站删除滚动条.显然没有必要.我把页面加载到21英寸的显示器上,仍然可以看到..

http://akrush95.freeoda.com/clash/

这是我的index.php中的html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
body,html{
  height:100%;
  margin: 0px;
  padding: 0px;
}
#title {
    padding-top: 20px;
    font-size: 36px;
}
#title #RHS {
    font-size: 40px;
    font-weight: bold;
}
.scoreboard {
    text-align: center;
}
.scores {
    font-size: 36px;
}
.score-title {
    font-size: 18px;
    text-decoration: underline;
}
#content {
    text-align: center;
    min-width: 250px;
}
#eventcontainer {
    padding: 10px;
    float: right;
    background-color: #999;
    width: 200px;
    min-height: …
Run Code Online (Sandbox Code Playgroud)

html scrollbar

4
推荐指数
1
解决办法
8961
查看次数

使用示例响应式抽屉时材料 UI 表没有响应

我创建了一个 Web 应用程序,其基础来自响应式抽屉上的 Material-UI 示例

我试图让一个表格响应屏幕宽度调整大小,但是由于某种原因,ResponsiveDrawerMaterial-UI 提供的容器破坏了内容(即表格)的响应能力

这是我写的一个完全响应的示例

应用程序.js

import React from "react";
import ReactDOM from "react-dom";
import Table from "@material-ui/core/Table/Table";
import TableHead from "@material-ui/core/TableHead/TableHead";
import TableRow from "@material-ui/core/TableRow/TableRow";
import TableCell from "@material-ui/core/TableCell/TableCell";
import TableBody from "@material-ui/core/TableBody/TableBody";
import Paper from "@material-ui/core/Paper/Paper";
import Grid from "@material-ui/core/Grid/Grid";

import "./styles.css";

function App() {
  return (
    <div className="App">
      <Grid container justify={"center"}>
        <Grid item xs={12} md={10} style={{ padding: "8px" }}>
          <Paper style={{ overflowX: "auto" }}>
            <Table style={{ minWidth: …
Run Code Online (Sandbox Code Playgroud)

responsive-design reactjs material-ui

4
推荐指数
1
解决办法
7892
查看次数

将 spring boot maven 项目作为依赖添加到另一个项目(本地)

I am looking to use one SB project as a dependency in another project -- without using a parent pom and locally. I have done this before using a parent pom and specifying modules, but I am looking at splitting up the repo and need to achieve the same without the parent pom.

I have found a few SO posts outlining ways of doing this, but none of them seem to work for me. They all involve mvn installing …

java spring maven spring-boot

4
推荐指数
1
解决办法
2187
查看次数

在视图外部创建的 UIButton 不起作用

我正在故事板中制作一个应用程序。我想要一个教程式的视图。我决定使用自由格式视图控制器,并用 600x600 的视图填充它(算作页面)。我遇到的问题是,当我有一个 UI 按钮动画到下一页时,在可见视图之外创建的按钮似乎不起作用。我什至移动了一个视图,因此按钮是一半可见的,当我移动视图时,只有一半的按钮起作用。

这是我的下一页代码:

- (void)nextPage {
    if (scrolling) return;
    scrolling = YES;

    [UIView animateWithDuration:0.3 animations:^{
        CGRect frame = self.tutorialView.frame;
        frame.origin.x -= 50; //frame.size.width;
        [self.tutorialView setFrame:frame];
    }];

    scrolling = NO;
}
Run Code Online (Sandbox Code Playgroud)

出于测试目的,我目前仅移动 50 像素,而不是整个页面。

图片1 图片2

出于测试目的,我已经启动了一半,但只有一半的按钮起作用。我已经从第二个视图开始,在另一个视图的顶部可见一半,并且发生了同样的事情(只有一半的按钮起作用)。否则,当我点击第一个视图上的下一个按钮时,第二个视图上的按钮不起作用(在初始视图之外创建的按钮)。

objective-c uibutton ios xcode6

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

Material UI 缩小动画然后删除

我正在创建一个动态界面,用户可以在其中添加和删除动态数量的项目。有一个添加按钮,每个项目都有一个删除按钮。我将每个项目都包含在 a 中Zoom以给它一些动画。添加新项目时,这种方法效果很好。当我删除该项目时,我遇到了问题,因为它会从 DOM 中取消渲染该项目,并且动画会丢失。是否有一种关于转换的回调,我可以使用它来更新包含动画后的项目的数组?或者可能有更好的解决方案?

我概述了实现这一目标的两种可能的尝试,但两者都存在问题。第一次尝试让我的项目在被删除时没有动画,第二次尝试让我在它们曾经存在的地方留下了间隙(注意:网格是我设计中所需的组件)

代码沙箱:https://codesandbox.io/s/l2lly078kq

import React from "react";
import Typography from "@material-ui/core/Typography";
import Button from "@material-ui/core/Button";
import Grid from "@material-ui/core/Grid";
import Paper from "@material-ui/core/Paper";
import Zoom from "@material-ui/core/Zoom/Zoom";

let itemCount = 0;

export default class extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      items: [],
      items2: [],
      hiddenItems: []
    };
  }

  handleAddItem = () => {
    let items = this.state.items;
    items.push(`Item ${itemCount++}`);
    this.setState({ items });
  };

  handleDeleteItem = index => {
    let items …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs material-ui

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