我正在尝试在原始 html 页面之上创建一个灰色透明背景屏幕。到目前为止,我所做的是将一个 div (使用 jquery)附加到具有以下 css 样式的 body 标记:
.spesificPropertiesDiv {
position: absolute;
display: block;
top: 0px;
width: 100%;
height: 100%;
background-color: black;
opacity: 0.5;
z-index: 6000;
text-align: center;
}
Run Code Online (Sandbox Code Playgroud)
正如我之前提到的,我将一个包含此类的 div 添加到主体中。当我将其附加到大屏幕(24 英寸)上时,每个效果都很好,但是当我将其附加到 16 英寸显示屏上时,灰屏 div 的高度比主体高度小 100 px。我需要提到的另一件事是,在大屏幕上,页面适合屏幕,而在较小的屏幕上,会出现滚动条,使页面的下侧可见。
为什么会发生这种情况?我该如何修复它?谢谢!
我创建了SeekBar类的扩展:
package com.simplemathgame;
import android.content.Context;
import android.widget.SeekBar;
import android.widget.TextView;
public class SeekBarPlus extends SeekBar {
private TextView numberOfDrills;
public SeekBarPlus(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
public void onStartTrackingTouch(SeekBar seekBar) {
// TODO Auto-generated method stub
}
public void onStopTrackingTouch(SeekBar seekBar) {
// TODO Auto-generated method stub
}
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {
// TODO Auto-generated method stub
numberOfDrills.setText(progress);
}
public void setTextView(TextView textView){
numberOfDrills = textView;
}
}
Run Code Online (Sandbox Code Playgroud)
这是xml布局文件:
<?xml version="1.0" encoding="utf-8"?> …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用12:00的小时初始化Joda-Time DateTime对象,这是我如何做到这一点:
public static final long MINUTE = 60 * 1000;
public static final long HOUR = 60 * MINUTE;
DateTime defaultDate = new DateTime(HOUR * 12);
System.out.print("the hour is: " + defaultDate.getHourOfDay()) // getting 14
Run Code Online (Sandbox Code Playgroud)
为什么我得到14而不是12?也许妈妈没教我怎么读时钟吧?!
这是我的两条路线:
Route::resource('tournament/{tourId}/phase/{phaseId}/bets', 'PhaseController@getPhaseBets');
Route::resource('tournament/{tourId}/phase/{phaseId}', 'PhaseController@getPhaseInfo');
Run Code Online (Sandbox Code Playgroud)
但是我在尝试运行任何GET api时遇到此异常:
Route pattern "/api/tournament/{tourId}/phase/{phaseId}/{{phaseId}}" cannot reference variable name "phaseId" more than once.
Run Code Online (Sandbox Code Playgroud)
从它得到了{{phaseId}}吗?为什么我收到这个错误?!
我有一个名为listOfDrills的列表,它有Iterator drillIt,有些为什么迭代器没有next()值(我很痛,列表不是空的,因为它可以正常工作listOfDrills.get(0)).这是代码:
package com.simplemathgame;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
public class GamePlayActivity extends Activity {
int addDrills;
int subDrills;
int mulDrills;
int divDrills;
int minBound;
int maxBound;
TextView drillTextPlace;
Button nextButton;
Button backButton;
List<Drill> listOfDrills = new ArrayList<Drill>();
Iterator<Drill> drillIt = listOfDrills.iterator();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_game_play);
//get values from other activity
Bundle extras …Run Code Online (Sandbox Code Playgroud) 也许这个问题之前曾在这里问过,但我在这里找不到.
对于Java开发人员来说这是一个基本问题,但是在这里说:我说我有一个带有属性a的A类.这两个构造函数有什么区别:
public abstract class A
{
protected String a;
public A()
{
a = "text";
}
}
Run Code Online (Sandbox Code Playgroud)
第二个:
public abstract class A
{
protected String a;
public A()
{
this.a = "text"; //Here is the same with this
}
}
Run Code Online (Sandbox Code Playgroud)