Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextBlock在NavMenuItem中文字居中异常 #222

Open
LeoChen98 opened this issue Apr 17, 2024 · 4 comments
Open

TextBlock在NavMenuItem中文字居中异常 #222

LeoChen98 opened this issue Apr 17, 2024 · 4 comments
Assignees

Comments

@LeoChen98
Copy link

第一次使用Avalonia,我不确定是不是我设置问题,这个Home设置居中之后总觉得往右偏了一点,尝试过强制Padding="0"也没有用。

<Grid Height="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}, Path=Height}" ColumnDefinitions="150,*">
    <u:NavMenu Grid.Column="0"
               Margin="0,-26,0,0"
               HorizontalAlignment="Stretch"
               VerticalAlignment="Center">
        <u:NavMenuItem HorizontalAlignment="Stretch">
            <u:NavMenuItem.Header>
                <TextBlock Text="Home"
                           HorizontalAlignment="Stretch"
                           VerticalAlignment="Center"
                           TextAlignment="Center" />
            </u:NavMenuItem.Header>
        </u:NavMenuItem>

    </u:NavMenu>
</Grid>

image

@rabbitism
Copy link
Member

因为预留了icon的位置和margin

@rabbitism rabbitism self-assigned this Apr 17, 2024
@LeoChen98
Copy link
Author

因为预留了icon的位置和margin

佬早,请问logo位置可以隐藏吗?

@rabbitism
Copy link
Member

因为预留了icon的位置和margin

佬早,请问logo位置可以隐藏吗?

我今天康康

@LeoChen98
Copy link
Author

因为预留了icon的位置和margin

佬早,请问logo位置可以隐藏吗?

我今天康康

好的,谢谢佬,不急,只是个人兴趣项目,不急用,您有空再看就行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants