我正在使用1个XML中的Imageview和Button,我正在从webServer中将图像作为URL重新显示并在ImageView上显示它.现在,如果单击按钮(保存),我需要将该特定图像保存到SD卡中.这该怎么做?
注意:当前图像应保存.

嘿伙计我自己第一次尝试实现布局重量,有点我尝试使用线性布局它运行良好,但是当我尝试使用相对和线性布局时出现问题.你们可以告诉我这里有什么问题吗
我的XML文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/Linearlayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:weightSum="100" >
<RelativeLayout
android:id="@+id/Rlayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="45" >
<Gallery
android:id="@+id/Gallery01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:spacing="4dip" >
</Gallery>
</RelativeLayout>
<RelativeLayout
android:id="@+id/Rlayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="10"
android:orientation="vertical" >
<ImageView
android:id="@+id/ImageView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/ImageView02"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="fitXY" />
</RelativeLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/navbar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="45"
android:background="@drawable/button1"
android:orientation="horizontal"
android:weightSum="100" >
<Button
android:id="@+id/makerback"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:layout_weight="20"
android:background="@drawable/makerback" />
<Button
android:id="@+id/makerphoto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:layout_weight="20"
android:background="@drawable/makerphoto" />
<Button
android:id="@+id/makerselves"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:layout_weight="20"
android:background="@drawable/makerselves" …Run Code Online (Sandbox Code Playgroud) 我已经尝试了很多次,但我知道我遗漏了一些东西,请你们解释一下.. 以下是什么,我已经尝试过了
<ImageView
android:id="@+id/Dicimage"
android:layout_width="130px"
android:layout_height="100px"
android:src="@drawable/slang"
android:background="@drawable/corner"
android:padding="1dp"/>
Run Code Online (Sandbox Code Playgroud)
在资源文件夹中创建 Corner XML
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#fff"/>
<stroke android:width="0dp"
android:color="#ff000000"/>
<padding android:left="2dp"
android:top="2dp"
android:right="2dp"
android:bottom="2dp"/>
<corners android:radius="30px"/>
</shape>
Run Code Online (Sandbox Code Playgroud)
我得到的是,边框只是圆角矩形,但图像的形状仍然是矩形
我需要计算存储在SD卡中的图像数量,因此我想将图像命名为Sample0,Sample1,Sample2,Sample3等.可能吗?
当我点击星星时,我正在调整小数值,如1.0,1.5,2.0,2.5等等
如何在自定义评级栏中获得整数评级?
可能吗?
ratingbar.setOnRatingBarChangeListener(new OnRatingBarChangeListener()
{
public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser)
{
Toast.makeText(Rating.this, "New Rating: " + rating, Toast.LENGTH_SHORT).show();
}});
}
Run Code Online (Sandbox Code Playgroud) 在我的Android应用程序中,我想在双引号之间更改字符串的值.例如,我想替换{"txt":为{"":
我尝试了以下正则表达式,但它们不起作用......
String abc=replace(str, "{\\txt\\:", "");
String abc=replace(str, "{'txt':", "");...,etc
Run Code Online (Sandbox Code Playgroud)
任何人都可以提供帮助.