gpt4 book ai didi

html - 删除 MFMailComposeViewController HTML 右边距?

转载 作者:行者123 更新时间:2023-11-29 13:31:41 25 4
gpt4 key购买 nike

我正在尝试使用 MFMailComposeViewController 从我的应用程序发送 HTML 电子邮件,但我遇到了一个问题,即右侧有奇怪的填充。

这是我正在使用的 HTML:

</br>
</br>
<a href='itms-apps://itunes.apple.com/app/id444395321'>
<img src='http://brianensorapps.com/whirlworld/wwad.png' height='80' width='320' style='position:relative;left:-10px;margin-right:0px;padding-right:0px;'/>
</a>

我不确定需要哪些正确的 CSS 标签。现在都没有工作。 position 和 left 标签用于消除左边距。

这是我试图避免的情况的图片,用户可以向右滚动经过我的横幅: Issue

还要求我发布用于呈现 MFMailComposeViewController 的代码:

sharingVC = [[MFMailComposeViewController alloc] init];
sharingVC.mailComposeDelegate = self;
sharingVC.navigationBar.tintColor = [UIColor lightGrayColor];
[sharingVC setSubject:@"Check out this app"];
[sharingVC setMessageBody:[NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"sharingEmail.html"] usedEncoding:nil error:nil] isHTML:YES];
[self presentViewController:sharingVC animated:YES completion:nil];

最佳答案

您将左边距设置为 -10px,这会将所有内容移至左侧(为您提供 10px 的右边距)

在样式属性中,将 left: -10px 更改为 left:0px 这样您的 html 代码如下所示:

</br>
</br>
<a href='itms-apps://itunes.apple.com/app/id444395321'>
<img src='http://brianensorapps.com/whirlworld/wwad.png' height='80' width='320' style='position:relative;left:0;margin-right:0px;padding-right:0px;'/>
</a>

我认为您真正想要的是将位置设置为绝对位置并将左侧设置为 0,如下所示:

</br>
</br>
<a href='itms-apps://itunes.apple.com/app/id444395321'>
<img src='http://brianensorapps.com/whirlworld/wwad.png' height='80' width='320' style='position:absolute; left:0px' />
</a>

在我的测试中,显示图像从屏幕左侧一直到右侧,没有水平滚动。

关于html - 删除 MFMailComposeViewController HTML 右边距?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11697984/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com