簡體   English   中英

React &amp; Material UI:位置<IconButton>在右下角<Paper> (無FAB)

[英]React & Material UI: Position <IconButton> on bottom right of <Paper> (No FAB)

問題

我有一個 react/material-ui 實​​現,我想在其中顯示一個浮動在紙張右下角的編輯圖標。 我已經弄清楚如何讓它漂浮在整個屏幕的右下角,但這不是我在這里的目標。

當前行為:

在此處輸入圖片說明

預期行為 在此處輸入圖片說明

讓圖標按鈕浮動在紙組件的右下角。

<Paper classnName={classes.paper}>

    <IconButton
      onClick={handleVisionEditCick}
      style={{ position: "???", bottom: 3, right: 3 }}
     >
        <EditIcon className={classes.EditIcon} />
    </IconButton>
    <Typography variant="h5" component="span" color="textPrimary">
         {vision}
    </Typography>
</Paper>

這可能不是最好的解決方案,但您可以嘗試使用 Grid

      <Grid container justify="flex-end" alignItems="flex-end">
        <IconButton style={{ bottom: 3, right: 3 }}>
          <Edit className={classes.EditIcon} />
        </IconButton>
      </Grid>

例子

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM