因此,放置div标题应该理论上放在div的顶部。这段代码是从我网站的另一个页面复制并粘贴的,我刚刚更改了div名称,因为其他一切都是相同的。但是,出于某种原因,我的div标题和div都显示在我的页面上,有没有人知道为什么?
我的CSS:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = (TextView) findViewById(R.id.textView);
minutesText = (EditText) findViewById(R.id.minutesText);
secondsText = (EditText) findViewById(R.id.secondsText);
startButton = (Button) findViewById(R.id.startButton);
intervalCount = (EditText) findViewById(R.id.intervalCount);
startButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (minutesText.getText().toString().equals("")) {
minutesInt = 0;
} else {
minutesString = minutesText.getText().toString();
minutesInt = Integer.parseInt(minutesString);
}
secondsString = secondsText.getText().toString();
if (secondsText.getText().toString().equals("")) {
secondsInt = 0;
} else {
secondsString = secondsText.getText().toString();
secondsInt = Integer.parseInt(secondsString);
}
if (intervalCount.getText().toString().equals("")) {
intervals = 0;
} else {
intervalsString = intervalCount.getText().toString();
intervals = Integer.parseInt(intervalsString);
}
final int timerAmount = ((minutesInt * 60) + (secondsInt)) * 1000;
Log.i("Hello, ", "intervals are " + intervals);
new CountDownTimer(timerAmount, 1000) {
@RequiresApi(api = Build.VERSION_CODES.N)
public void onTick(long millisUntilFinished) {
activeRunning = true;
String timeLeft = String.format("%02d : %02d",
TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished),
TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) -
TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished))
);
textView.setText("Reamining: " + timeLeft);
}
public void onFinish() {
textView.setText("FINISHED1");
try {
Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);
r.play();
} catch (Exception e) {
e.printStackTrace();
}
new CountDownTimer(5000, 1000) {
public void onTick(long millisUntilFinished) {
restRunning = true;
activeRunning = false;
String timeLeft = String.format("%02d : %02d",
TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished),
TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) -
TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished))
);
textView.setText("Rest: " + timeLeft);
}
public void onFinish() {
restRunning = false;
textView.setText("FINISHED2");
try {
Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);
r.play();
} catch (Exception e) {
e.printStackTrace();
}
}
}.start();
if (intervals > 0) {
intervals--;
this.start();
}
}
}.start();
intervals--;
}
});
}
}
答案 0 :(得分:0)
没有你的HTML很难知道,但我的猜测是它与你的#3D有关... HTML ID不能从数字开始。尝试将ID更改为以字母开头并更改您的CSS,并查看是否可以修复它。