小编Ama*_*alo的帖子

XAxisLeft的Android mp android图表集类型脸

我有一个使用库MPAndroidChart的折线图

    mChart.setData(data);
                        mChart.getAxisLeft().setTypeface(MyApplication.giloryItaly);
                        mChart.invalidate();

                        mChart.getXAxis().setTypeface(MyApplication.giloryItaly);
                        mChart.getAxisRight().setTypeface(MyApplication.giloryItaly);
Run Code Online (Sandbox Code Playgroud)

问题是,AxisLeft即使使用,字体值也无法更改

mChart.getAxisLeft().setTypeface(MyApplication.giloryItaly);
Run Code Online (Sandbox Code Playgroud)

但适用于 XAxis

任何解决方案如何改变字体类型AxisLeftAxisRight?

charts android android-studio android-typeface mpandroidchart

6
推荐指数
1
解决办法
1294
查看次数

MPAndroidChart如何将x轴设置到图表的底部?

我已经下载了MPAndroidChart库来绘制LineChart,我注意到这个LineChart总是在yAxis上绘制xAxis,我需要在yAxis的底部绘制xAxis

这是我初始化图表的方式

  mChart = (LineChart) findViewById(R.id.chart1);

    mChart.setDescription("");
    mChart.setNoDataTextDescription("You need to provide data for the chart.");

    // enable value highlighting
    mChart.setHighlightEnabled(true);

    // enable touch gestures
    mChart.setTouchEnabled(true);

    mChart.setDragDecelerationFrictionCoef(0.9f);

    // enable scaling and dragging
    mChart.setDragEnabled(true);
    mChart.setScaleEnabled(true);
    mChart.setDrawGridBackground(false);
    mChart.setHighlightPerDragEnabled(true);
    mChart.setBackgroundColor(Color.WHITE);

    XAxis xAxis = mChart.getXAxis();

    xAxis.setDrawGridLines(false);




    YAxis leftAxis = mChart.getAxisLeft();

    leftAxis.setTextColor(ColorTemplate.getHoloBlue());
    leftAxis.setAxisMaxValue(200f);
    leftAxis.setDrawGridLines(false);


    YAxis rightAxis = mChart.getAxisRight();
    rightAxis.setDrawAxisLine(false);
    rightAxis.setTextColor(Color.WHITE);
    rightAxis.setDrawGridLines(false);

    MyMarkerView mv = new MyMarkerView(this, R.layout.custom_marker_view);

    // set the marker to the chart
    mChart.setMarkerView(mv);
Run Code Online (Sandbox Code Playgroud)

android mpandroidchart

5
推荐指数
1
解决办法
7058
查看次数

来自调试器的Ios Xcode消息:由于内存问题而终止

我有一个带有集合视图的应用程序和此集合视图中的一个单元格,可重定向到外部链接.

每当该链接打开时,应用程序在后台崩溃并提供调试器:

"由于内存问题而终止".

如果我只按主页按钮,应用程序继续正常工作.

if (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation)) Portrait = NO;
else if (UIDeviceOrientationIsPortrait([UIDevice currentDevice].orientation)) Portrait = YES;
else Portrait = [self getStatusBarOrientations];

if(indexPath.row == 4 && indexPath.section == 0)
{
    NewsListCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Cell4"  forIndexPath:indexPath];

    if ([languageID isEqualToString:@"1025"])
    {
        cell.title.text =[NSString stringWithFormat:@"????? ????? %@", [self.pdfCoverDict valueForKey:@"PdfDate"]];
        [cell.contentView setTransform:CGAffineTransformMakeScale(-1, 1)];
    } else {
        cell.title.text =[NSString stringWithFormat:@"Today's Edition %@", [self.pdfCoverDict valueForKey:@"PdfDate"]];
    }
    NSURL *imageUrl = [NSURL URLWithString:[self.pdfCoverDict valueForKey:@"CoverImage"]];
    [cell.imageView sd_setImageWithURL:imageUrl];
    cell.imageViewWidth.constant = Portrait ? 246 : 331;
    cell.imageViewHeight.constant = Portrait ? …
Run Code Online (Sandbox Code Playgroud)

xcode ios

4
推荐指数
1
解决办法
2万
查看次数

java中热敏打印机的命令

我有一套用于我的热敏打印机的命令:这是一个例子

ASCII ESC a n
Decimal 27 97 n
Hexadecimal 1B 61 n

Description Default is 0
0 ? m ? 2 or 48 ? m ? 50
Align left: n=0,48
Align middle: n=1,49
Align right: n=2,50 
Run Code Online (Sandbox Code Playgroud)

我想知道如何使用这个命令?? 我知道我需要像这样写入打印机命令:

   byte [] cmd = new byte[3];
   cmd[0]=??
   cmd[1]???
    mmOutputStream.write(cmd);//out put stream of soccket connected to
    //printer by bluetooth
Run Code Online (Sandbox Code Playgroud)

有关更多说明:我想向我的打印机添加命令以使文本显示在中心

java printing android thermal-printer

0
推荐指数
1
解决办法
3998
查看次数

Android检查应用程序是否关闭

我有一个android应用程序,我需要一个功能或任何广播接收器,可以检查应用程序是否关闭。.我不需要在每个活动中调用destroy(该应用程序中大约有20个活动)应用程序类中的功能

public class ApplicationLifeCycleManager implements ActivityLifecycleCallbacks {

/** Manages the state of opened vs closed activities, should be 0 or 1.
 * It will be 2 if this value is checked between activity B onStart() and
 * activity A onStop().
 * It could be greater if the top activities are not fullscreen or have
 * transparent backgrounds.
 */
private static int visibleActivityCount = 0;

/** Manages the state of opened vs closed activities, should be 0 or 1 …
Run Code Online (Sandbox Code Playgroud)

android android-lifecycle android-activity android-activitymanager

0
推荐指数
3
解决办法
6298
查看次数