假设我正在做类似测验的事情,我有一个计数器来显示已正确回答的问题数量.当一个问题得到正确回答,并显示一个新屏幕(活动)时,如何将该号码转移到下一个屏幕?
我想在Android应用程序中使用一些适合的免费图表引擎显示条形图.这就是我对图表的看法:
我正在尝试使用以下功能.
添加onclick到每个栏(红色,蓝色,绿色).
在顶部而不是底部显示图例.
在Y轴上,它显示我想要显示的值1 - 200.
并且onlick显示每个栏顶部的值.
我已经调查过,Achart engine
但它没有像这样的条形图.
请帮帮我.
我正在将PDF写入SD卡并使用以下代码:
byte[] data = new byte[20000];
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int nRead;
InputStream fileInputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
while ((nRead = fileInputStream.read(data, 0, data.length)) != -1) {
buffer.write(data, 0, nRead);
}
buffer.flush();
byte[] bytesToWrite = buffer.toByteArray();
fileInputStream.read(bytesToWrite);
fileInputStream.close();
FileOutputStream fileOutputStream = null;
String outputFileName = outputDirName + "/" + fileName;
fileOutputStream = new FileOutputStream(outputFileName);
BufferedOutputStream bos = new BufferedOutputStream(fileOutputStream);
bos.write(bytesToWrite);
bos.flush();
bos.close();
Run Code Online (Sandbox Code Playgroud)
如果我试图一次写20个PDF,它工作正常,但如果它超过它,它给了我OutOfMemory错误.
可能是什么问题?
我正在开发Windows Phone 8 app
并在XAML中拥有这样的Image视图:
<Image Name="Image"
Grid.Row="0"
Visibility="Collapsed"
Width="Auto"
Height="Auto"
Tap="Image_tap"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="1,1,1,1"/>
Run Code Online (Sandbox Code Playgroud)
现在我有这个事件叫Tap="Image_tap"
,当我点击图像我想要全屏显示相同的图像,顶部和底部没有任何栏,如何实现这一点?
嗨伙计们我有一个xml,我有以下内容:
John:How are you?
Mary:I am fine.How about you.
John:what is your plan today?
Run Code Online (Sandbox Code Playgroud)
我从xml中获取这些值.现在我需要John,Mary
带有BOLD
和的文本different color
.而且我还需要更改警报窗口的背景颜色.
这是我正在使用的警报对话框:
AlertDialog.Builder bu = new AlertDialog.Builder(this);
bu.setMessage(""+((Node) textFNListU.item(0)).getNodeValue().trim().replace("$","\n"));
bu.setCancelable(true);
bu.setPositiveButton("OK",new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
// TODO Auto-generated method stub
dialog.cancel();
}
});
bu.create().show();
Run Code Online (Sandbox Code Playgroud)
((Node) textFNListU.item(0)).getNodeValue().trim())
----这是我从xml获得的价值
请帮忙.
这是我连接到服务器并在MyUtilitiesActivity中获取响应的方法.
private static response = "";
public static String send(final Activity act, final String url, final String keys[], final String values[])
{
try{
HttpParams httpParameters = new BasicHttpParams();
// Set the timeout in milliseconds until a connection is established.
HttpConnectionParams.setConnectionTimeout(httpParameters, 5000);
// Set the default socket timeout (SO_TIMEOUT)
// in milliseconds which is the timeout for waiting for data.
HttpConnectionParams.setSoTimeout(httpParameters, 5000);
HttpClient httpclient = new DefaultHttpClient(httpParameters);
if(keys == null && values == null)
{
HttpGet get = new HttpGet(url);
// …
Run Code Online (Sandbox Code Playgroud) 我有两个不同父母的按钮.
我正在尝试将按钮效果应用于按钮触摸.
这是我的代码:
public class ButtonHighlighterOnTouchListener implements OnTouchListener {
final Button button;
public ButtonHighlighterOnTouchListener(final Button imageButton) {
super();
this.button = imageButton;
}
public boolean onTouch(final View view, final MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
button.getBackground().setColorFilter(Color.parseColor("#B7B2B0"), PorterDuff.Mode.MULTIPLY);
button.invalidate();
break;
case MotionEvent.ACTION_CANCEL:
button.getBackground().clearColorFilter();
button.invalidate();
break;
case MotionEvent.ACTION_UP:
button.getBackground().clearColorFilter();
button.invalidate();
break;
}
return false;
}
}
Run Code Online (Sandbox Code Playgroud)
它将效果应用于按钮,但问题是因为我有2个按钮,即使我点击一个按钮,效果也会应用到另一个按钮.
请帮我解决这个问题.
我正在使用Windows Phone 8应用程序.
我有一条通往图像的道路 - /Data/Images/image1.png
.我能够在屏幕上显示此图像,但我想在渲染之前更改图像的宽度和高度.
这就是我在显示图像的方式 webbrowser control
webbrowser.Append("<img src=""+path+ width=\"250\" height=\"250\" style=\"vertical-align:middle\" alt=\"\"></img>"/>"
Run Code Online (Sandbox Code Playgroud)
在这里我设置宽度和高度,250x250
但我想改变高度和宽度,因为一些图像不好看.
android ×6
c# ×2
achartengine ×1
alert ×1
bar-chart ×1
charts ×1
colorfilter ×1
effects ×1
fullscreen ×1
image ×1
java ×1
progress-bar ×1
silverlight ×1
variables ×1
wpf ×1
xml ×1