Özel rengimi AppBar üstbilgisi için kullanmaya çalışıyorum. AppBar 'Benim AppBar' başlığı vardır. Ana tema rengim olarak beyaz kullanıyorum. 'Başlığını: Bu 'AppBar başlığındaki farklı renk nasıl uygulanır? Material-ui
import React from 'react';
import * as Colors from 'material-ui/styles/colors';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import AppBar from 'material-ui/AppBar';
import TextField from 'material-ui/TextField';
const muiTheme = getMuiTheme({
palette: {
textColor: Colors.darkBlack,
primary1Color: Colors.white,
primary2Color: Colors.indigo700,
accent1Color: Colors.redA200,
pickerHeaderColor: Colors.darkBlack,
},
appBar: {
height: 60,
},
});
class Main extends React.Component {
render() {
// MuiThemeProvider takes the theme as a property and passed it down the hierarchy
// using React's context feature.
return (
<MuiThemeProvider muiTheme={muiTheme}>
<AppBar title="My AppBar">
<div>
< TextField hintText = "username"/>
< TextField hintText = "password"/>
</div>
</AppBar>
</MuiThemeProvider>
);
}
}
export default Main;
Fakat, palet stilleri appbar geçersiz İşte
benim kodudur' da aynı 'beyaz' rengini kullanıyor çubuğun ama AppBar ait 'başlık' için iyi çalışır renk ve başlık görüntülenmiyor. Bir şey eklesem mi yoksa hiç yerim mi var?
here tarif? İthalatlardan sonra App.js'de benzer bir şey yarattım ve hiçbir renk değişmedi. – HomeMade
Ah, çalışmayı başardım, '' muiTheme = {muiTheme} '' ı '' '' '' '' ı '' '' ı eklemeyi unuttum –
HomeMade