我在自定义arrayAdapter中实现自定义getFilter时遇到问题.实际上我不知道如何实现它.试过各种代码,但仍然没有运气.这是我的自定义数组适配器.
package com.test.FilterableList.Adapters;
import java.util.ArrayList;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.test.FilterableList.Models.ListTO;
import com.test.FilterableList.R;
import android.widget.Filterable;
public class FilterableAdapter extends ArrayAdapter<ListTO> implements Filterable {
// declaring our ArrayList of items
public ArrayList<ListTO> objects;
/* here we must override the constructor for ArrayAdapter
* the only variable we care about now is ArrayList<Item> objects,
* because it is the list of objects we want to display.
*/
public FilterableAdapter(Context context, int textViewResourceId, ArrayList<ListTO> objects) …
Run Code Online (Sandbox Code Playgroud) 我有一个应用程序,我必须打印RDLC
报告,而不显示printDialog并使用应用程序中定义的默认指定的打印机.下面是我的测试实现代码.
Microsoft.Reporting.WinForms.ReportViewer reportViewerSales = new Microsoft.Reporting.WinForms.ReportViewer();
Microsoft.Reporting.WinForms.ReportDataSource reportDataSourceSales = new Microsoft.Reporting.WinForms.ReportDataSource();
reportViewerSales.Reset();
reportViewerSales.LocalReport.ReportPath = @"Sales.rdlc";
reportDataSourceSales.Name = "SalesTableDataSet";
int i = 1;
foreach (Product item in ProductSalesList)
{
dataset.CurrentSales.AddCurrentSalesRow(i, item.Name, item.Quantity.ToString(), item.Price.ToString(), item.Price.ToString());
i++;
}
reportDataSourceSales.Value = dataset.CurrentSales;
reportViewerSales.LocalReport.DataSources.Add(reportDataSourceSales);
dataset.EndInit();
reportViewerSales.RefreshReport();
reportViewerSales.RenderingComplete += new RenderingCompleteEventHandler(PrintSales);
Run Code Online (Sandbox Code Playgroud)
这是我的渲染完成方法
public void PrintSales(object sender, RenderingCompleteEventArgs e)
{
try
{
reportViewerSales.PrintDialog();
reportViewerSales.Clear();
reportViewerSales.LocalReport.ReleaseSandboxAppDomain();
}
catch (Exception ex)
{
}
}
Run Code Online (Sandbox Code Playgroud) 我一直在研究Android的启动器应用程序,类似于nova启动器.我已经设置了OnItemLongClickListener和OnDragListener.当我长按一个图标时,会显示一个弹出窗口,其中包含"删除","更改图标"等菜单.下图显示了长按时打开弹出窗口的应用程序的进度.
问题是当弹出窗口打开时拖动工作但下降不起作用.一旦弹出窗口打开,我似乎无法记录x,y位置.同样,当执行drop时,logcat中会显示以下消息.
I/ViewRootImpl: Reporting drop result: false
Run Code Online (Sandbox Code Playgroud)
我的代码在OnDragListener中是这样的
public boolean onDrag(View v, DragEvent event) {
int dragEvent = event.getAction();
switch (dragEvent)
{
case DragEvent.ACTION_DRAG_LOCATION:
//Open popup here; note: its opened only once. popup.show();
//Log.i("Position x : ", Float.toString(event.getX())); log x or y
/*code to detect x any y change amount and close the popup
once user drags the icon little further and app knows that
user is trying to drag instead of opening the popup
and hence close the popup. …
Run Code Online (Sandbox Code Playgroud) 我有一个名为ForgetPassword的动作.每次匿名尝试检索操作时,他/她都会被重定向到登录页面.以下是我的实现.
public ActionResult ForgotPassword(string UserName)
{
//More over when i place a breakpoint for the below line
//its not even getting here
return View("Login");
}
Run Code Online (Sandbox Code Playgroud)
这是我的web.config文件的一部分
<location path="">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
<location path="Content">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="Scripts">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="Images">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<authentication mode="Forms">
<forms loginUrl="/Home/Login" timeout="5" slidingExpiration="false" />
</authentication>
Run Code Online (Sandbox Code Playgroud) 我System.Windows.Controls.DataVisualization.Toolkit.dll
用来为我的基于C#的wpf应用程序生成图表.这是我的图表的xaml.
<chartingToolkit:Chart Name="chartDailySales"
Title="Monthly Sales"
VerticalAlignment="Top" Margin="10,10,0,0"
Height="262"
BorderBrush="#00000000"
DataContext="{Binding}"
IsTabStop="True"
Background="#ffbcd5c7">
<!-- Plot area-->
<chartingToolkit:Chart.PlotAreaStyle>
<Style TargetType="Grid">
<Setter Property="Background" Value="White" />
</Style>
</chartingToolkit:Chart.PlotAreaStyle>
<!-- Hide Legend-->
<chartingToolkit:Chart.LegendStyle>
<Style TargetType="Control">
<Setter Property="Width" Value="0"/>
<Setter Property="Height" Value="0"/>
</Style>
</chartingToolkit:Chart.LegendStyle>
<chartingToolkit:ColumnSeries DependentValuePath="Value"
IndependentValuePath="Key"
ItemsSource="{Binding}"
IsSelectionEnabled="False"
>
<chartingToolkit:ColumnSeries.DataPointStyle>
<Style TargetType="chartingToolkit:ColumnDataPoint">
<Setter Property="Background" Value="#ff217346"/>
<Setter Property="BorderBrush" Value="#ff217346" />
<Setter Property="BorderThickness" Value="1" />
</Style>
</chartingToolkit:ColumnSeries.DataPointStyle>
</chartingToolkit:ColumnSeries>
</chartingToolkit:Chart>
Run Code Online (Sandbox Code Playgroud)
这是填充数据的代码.
List<KeyValuePair<string, double>> monthlySalesList = new List<KeyValuePair<string, double>>();
monthlySalesList.Add(new KeyValuePair<string, double>("JAN", 1234 ));
monthlySalesList.Add(new KeyValuePair<string, double>("FEB", …
Run Code Online (Sandbox Code Playgroud) unicode
在java中显示字符显示“?” 标志。例如,我试图打印“?”。其unicode
编号为 U+0905,html 表示为“अ”。下面的代码打印“?” 而不是unicode
性格。
char aa = '\u0905';
String myString = aa + " result" ;
System.out.println(myString); // displays "? result"
Run Code Online (Sandbox Code Playgroud)
有没有办法unicode
直接从unicode
自身显示字符而不使用unicode
数字?IE ”?” 保存在文件中现在在jsp中显示文件。
我正在为我的项目工作开发一个Java桌面应用程序.我需要打印一张包含子总计和总字段以及表格数据的发票JTable
.我能够打印表格,但不能在同一页面打印.即JTable打印在第一页和小计,总打印在下一页.有没有办法在同一页面中打印两个数据.我不想使用报告引擎.只需使用内置的java打印服务.请指导我.
我想要的打印格式:
下图显示了GUI
下图显示了我到目前为止的报告.它的格式不正确.请帮忙
代码如下
JLabel title = new JLabel();
title.setText("Invoice");
title.setBounds(300, 200, 80, 30);
JTextField subTotal = new JTextField();
subTotal.setText("Sub Total : Rs. " + SubTotal.getText());
subTotal.setBounds(400, 200, 150, 30);
MyPrintable prt = new MyPrintable();
prt.addComponent(title);
prt.addComponent(billTable); //billTable is the JTable
prt.addComponent(subTotal);
prt.printIt();
Run Code Online (Sandbox Code Playgroud)
以下是我的Printable课程
class MyPrintable implements Printable
{
private ArrayList<JComponent> items;
public MyPrintable()
{
items = new ArrayList<>();
}
@Override
public int print(Graphics g, PageFormat pf, int page) throws PrinterException
{
if(page > 0) return Printable.NO_SUCH_PAGE; …
Run Code Online (Sandbox Code Playgroud) 我正在制作一个基本的启动器应用程序,在其中我需要通知栏和状态栏完全透明。所以我用下面的代码。
Window w = getWindow(); // in Activity's onCreate() for instance
w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
Run Code Online (Sandbox Code Playgroud)
可以做到这一点,但是功能键的颜色不是白色,如下图所示。
我如何使它变白?
我正在使用asp.net mvc3和我的项目以及jquery ajax方法.我已经能够验证输入,但如果我点击发布按钮,即使表单包含无效数据,也会发布数据.我知道这可以使用提交按钮解决.但我想使用我的jquery方法.我一直在使用asp.net mvc3客户端验证.这是我从表单发布数据的代码.
//jQuery
function PostForm(Url, FormID, Title) {
var dataTOPost = '#' + FormID; // Id of particular form to post
$.ajax({
url: Url,
type: 'POST',
data: $(dataTOPost).serialize(),
beforeSend: function () {
//display some loading pics
}
}).done(function (result) {
//if success do something
});
}
Run Code Online (Sandbox Code Playgroud)
我用它如下
<a onclick="PostForm('someurl','myform', 'Title of dialog');" >Submit</a>
Run Code Online (Sandbox Code Playgroud)
以下是正在验证的表单部分的屏幕截图.即使表单包含无效数据,表单也会发布.我该如何解决这个问题.谢谢.