Closed ShadowLJia closed 6 years ago
Find out why?
Me too. Have you figured it out? This is how I do it:
hud.mode = MBProgressHUDModeText;
hud.detailsLabel.text = message;
hud.detailsLabel.font = [UIFont systemFontOfSize:17.f];
[hud showAnimated:YES];
[hud hideAnimated:YES afterDelay:duration];
@ShadowLJia @wangbiye , hi, I think I find out the reason for this. As commented in the header file MBProgressHUD.h
of property button
says, the button is "Visible only if a target / action is added".
You can also find the impl of this visibility logic in -[MBProgressHUDRoundedButton intrinsicContentSize]
.
I added a breakpoint and executed po hud.button.allTargets
on the console, it logged this: {( <GrowingUIControlObserver: 0x17021edf0> )}
.
So I'm guessing maybe this is the reason for your issue too.
same issue.Have you solve it ? @zssr 怎么解决的?
@stillwalk , 我用不上那个按钮,然后直接就在 -[MBProgressHUDRoundedButton intrinsicContentSize]
中 return CGSizeZero
也可以修改HUD创建子视图里面的代码。
Thankyou @zssr
thanks, it's work for me.
hi, to those who use GrowingIO
, I have a better solution. Since the button is "visible only if a target / action is added".
removeTargetsAt(button: hud.button)
private static func removeTargetsAt(button: UIButton) {
for t in button.allTargets {
button.removeTarget(t, action: nil, for: .allEvents)
}
}
`self.hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:animated];
self.hud.button.hidden = YES;
is the button always shows?