如何在XML文件中为文本加下划线?我找不到一个选项textStyle.
我所拥有的是一项具有更严重性的活动,另一项活动具有不同的信息.但是,当我打开非服务器活动时,服务器关闭.有没有办法让我停下来?如果您需要查看任何代码,我很乐意展示它.
我有一个服务器女巫正在给我发一个字符串,如"False~False~False~True_False~True_False~"或者那种性质的东西所以我所做的就是把那个字符串分成了" 〜"所以我的代码是String[] AString = A2MCString.split("~");新的字符串数组我已经去了一个cheack,看看每个部分是真还是假使用if else语句
if (AString[0] == "True") {
Log.d("ClientActivity","Light ON");
On1.setBackgroundResource(R.drawable.selected_on);
}
else Log.d("ClientActivity","Light OFF");
Run Code Online (Sandbox Code Playgroud)
但是,即使服务器在我的字符串数组的第一部分发送给我,数组仍然反弹到其他地方说它是假的,即使它是真的吗?对我的问题有任何帮助谢谢!
EditText尝试输入时,软键盘掩盖了我的字段EditText。
如何防止软键盘遮盖我的EditText领域?
按下返回按钮后,我可以看到我输入的内容,因为软键盘不再覆盖了EditText。
我正在使用银河10.1英寸平板电脑。
XML格式
<ScrollView
android:layout_width="wrap_content"
android:layout_height="400dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="1) Project"
android:textColor="#000000"
android:layout_gravity="bottom"
android:textSize="25sp" />
<EditText
android:id="@+id/projectET"
android:layout_width="500dp"
android:layout_height="wrap_content"
android:textSize="25sp"
android:ems="10"
android:hint="Project"
android:inputType="textCapWords"
android:layout_gravity="bottom"/>
<CheckBox
android:id="@+id/projectCBM"
android:layout_width="wrap_content"
android:layout_height="55dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="2) Customer"
android:textColor="#000000"
android:layout_gravity="bottom"
android:textSize="25sp" />
<EditText
android:id="@+id/customerET"
android:layout_width="500dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textCapWords"
android:layout_gravity="bottom"
android:textSize="25sp"
android:hint="Customer" />
<CheckBox
android:id="@+id/customerCBM"
android:layout_width="wrap_content"
android:layout_height="55dp" />
</LinearLayout> …Run Code Online (Sandbox Code Playgroud) 我有一些收集数字的代码,我能够证明我正在编号,我会这样做但是当我去使用此代码保存数字时
public void SaveScore()
{
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putString("Score", (StringScore));
}
Run Code Online (Sandbox Code Playgroud)
然后我稍后在另一个页面中使用此代码调用它
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
ScoreString = (settings.getString("Score", "0"));
Score.setText(ScoreString + "%");
Run Code Online (Sandbox Code Playgroud)
它出现为0我知道这是默认号码,为什么我不保存号码?
android ×5
java ×2
arrays ×1
if-statement ×1
runnable ×1
scrollview ×1
split ×1
string ×1
textview ×1
underline ×1