ios:webview滚动无法正常工作

时间:2013-04-11 07:22:07

标签: ios uiwebview scroll

我是ios的新手,我正在尝试在splitview中显示webview。 将显示webview内容,但我无法在webview内容中滚动。它仍然是固定的。 以下是我的代码:

   - (void)viewDidLoad
{
    [super viewDidLoad];
        // Do any additional setup after loading the view from its nib.
    webViewProcDescription.userInteractionEnabled = YES;
    webViewProcDescription.scrollView.scrollEnabled = YES;

    [self configureView];
}



 - (void)configureView
{


    NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"Stage1" ofType:@"html"];

    NSString * htmlString = [NSString stringWithContentsOfFile:htmlFile encoding:NSUTF8StringEncoding error:nil];
    [webViewProcDescription loadHTMLString:htmlString baseURL:nil];
}

我也尝试使用UIScrollView,但仍然没有结果。我甚至尝试设置webview的属性,如userInteractionEnabled = YESwebViewProcDescription.scrollView.scrollEnabled = YESwebViewProcDescription.scalesPageToFit等,仍然相同。 我哪里错了?我该如何解决这个问题。

编辑:stage1.html代码

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="Content-Style-Type" content="text/css">
  <title></title>
  <meta name="Generator" content="Cocoa HTML Writer">
  <meta name="CocoaVersion" content="1187.34">
  <style type="text/css">
  </style>
<javascript type="text/javascript">
window.onload = function() {
    window.location.href = "ready://" + document.body.offsetHeight;
 }
</script>
</head>
<body>
    <h2>Stage I Reconstruction, Norwood Operation </h2>

    <p>Your child has complex single ventricle anatomy.  In a normal heart there are four chambers, two paired atria and two paired ventricles.  The wall between the atria is called the atrial septum, and likewise the wall between the ventricles is called the ventricular septum.  In a normal heart, deoxygenated “blue” blood returns from the body to the right atrium and then the right ventricle pumps the blood to the lungs where it is oxygenated.  After blood is oxygenated in the lungs it returns to the left atrium and then the left ventricle pumps it out through the aorta to supply oxygen to the head and body (Figure 1).  This pattern of blood flow is called an <i> in series circulation. </i> </p>

    <p>Children with complex cardiac anatomy may progress down the single ventricle pathway because either the left or right ventricle is severely under-developed; there is severe obstruction to aortic flow or multiple anomalies that makes it impossible to separate the right and left heart.  Lesions resulting in single ventricle anatomy include tricuspid atresia, hypoplastic left heart syndrome, double inlet left ventricle, unbalanced atrioventricular canal defects, complex transposition of the great arteries and heterotaxy syndrome.</p>

    <p>In the single ventricle heart, all of the deoxygenated “blue” blood from the body and all of the oxygenated blood from the lungs returns to a common atrial chamber where it mixes.  The mixed blood then empties into the ventricular chamber and is ejected out of the aorta to the head and body.  Pulmonary blood flow is established using a shunt that will be described below.  This type of circulation is called parallel circulation.</p>

    <p>The operative objectives in a stage I reconstruction for a patient with a single ventricle include establishing unobstructed systemic blood flow to the brain and body, unobstructed blood return from the lungs, non-distorted and normal sized pulmonary arteries, limited pulmonary blood flow at low pressure, balanced pulmonary and systemic flows and minimal atrioventricular valve regurgitation.</p>

    <p>Your child will be taken to the OR by the anesthesiologist where they will be put to sleep and then have IV’s and arterial access placed to continuously monitor blood pressure.  The sternum (breastbone) is divided to expose the heart.  We fully dissect the aorta, pulmonary artery and ductus arteriosus before preparing for cardiopulmonary bypass.  In order for us to operate on your child’s heart we have to use the cardiopulmonary bypass (CPB) machine.  When we get ready to put someone on “bypass” we first have to give a large dose of heparin, which is a blood thinner used to prevent blood clots.  We place special cannulae into the aorta or pulmonary artery and into the right atrium.  The CPB tubing is relatively long and in order to remove all of the air from the line we often have to use donated blood to “prime” the circuit.  Once we go on “bypass” all of the venous blood is returned to the bypass machine where it is oxygenated and then pumped into the aortic cannulae.  The CPB machine allows us to safely stop the heart while maintaining good blood pressure and oxygen delivery to the brain and body.</p>

    <p>As mentioned above, there are 2 main types of shunts used to supply blood to the lungs; the modified Blalock-Taussig (BT) shunt and the right ventricle-to-pulmonary artery (Sano) shunt.  A BT shunt is a short piece of gortex tubing, usually 3.5-4mm in diameter that is sutured to the base of the subclavian artery and implanted into the top of the right pulmonary artery.  A Sano shunt is larger piece of gortex tubing, usually 5-6mm, that is sutured directly to the right ventricle and implanted into the confluence of the right and left pulmonary arteries.  If your child is getting a BT shunt then we next place a special clamp across the right subclavian artery and suture a small, gortex tube to the base of the subclavian artery.  A small clip is placed across the shunt and the other end is completed later in the operation.</p>

</body>
</html>

1 个答案:

答案 0 :(得分:1)

发现错误。我添加了我的UIWebView的视图是意外not set to user interaction enabled = yes。 将主视图的User Interaction Enabled属性设置为YES后,它就开始工作了。