我试图创建一个包含2x2网格按钮(总共4个)的布局.我有以下,但它只在左上角创建按钮网格.我希望按钮网格填满整个屏幕.
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<Button
android:id="@+id/button2"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Button
android:id="@+id/button3"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<Button
android:id="@+id/button4"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</TableRow>
Run Code Online (Sandbox Code Playgroud)
嗨我试图将二进制文件存储在我写的基本批处理脚本中.基本上我希望脚本能够在某个时刻输出这个预先构建的文件,而不是从头开始创建它.
如果这是不可能的,那么我必须将该文件与批处理文件分开包含,然后将其移动到必要的位置,但我宁愿让用户看不到这个文件,这样看起来文件正在生成来自批次内.
这是可能的,如果是这样的话怎么样?提前致谢.
嗨,我正在尝试在字符串中的所有字符之间插入一个破折号.我做过这个,但它不会工作:
public static String expand (String word)
{
int stringLength = word.length();
for (int x=0; x<stringLength; x++){
word = new StringBuffer(word).insert(x, "-").toString();
}
return word;
}
Run Code Online (Sandbox Code Playgroud)
它会导致单词前面的破折号.我不明白为什么它不起作用.谢谢.