小编Ins*_*ull的帖子

如何删除ios图表条形图中每个条形图上方的值标签

每个条形图都有一个高于它的值,但每当我得到太多的数据条目时,这些值就会互相溢出并使它们自己变得不可读.编辑这些我能找到的唯一方法是将它们设置在每个条形的上方或下方.但是我想完全隐藏它们.我如何在swift中执行此操作?

ios swift ios-charts

8
推荐指数
3
解决办法
8877
查看次数

为什么我在android-pageradapter中遇到stackoverflow错误?

我只是想膨胀一个xml文件并在viewpager页面中显示它.

LLL

logcat的:

致命异常:在Android.wits.CompoundButton的android.graphics.drawable.DrawableContainer.jumpToCurrentState(DrawableContainer.java:179)上的android.graphics.drawable.BitmapDrawable.setAlpha(BitmapDrawable.java:406)中的主要java.lang.StackOverflowError. android.view.View.jumpDrawablesToCurrentState(ViewGroup.java:5158)在android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)的android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)上的jumpDrawablesToCurrentState(CompoundButton.java:319) :5158)在android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)at android位于android.view的android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)的android.view.View.jumpDrawablesToCurrentState(ViewGroup.java:5158)上的.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158).位于android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)的android.view.jumpDrawablesToCurrentState(ViewGroup.java:5158)上的ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)位于android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup) .java:5158)在android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)的android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)上的android.view.View.jumpDrawablesToCurrentState(ViewGroup.java:5158)在Android.view上的android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)的android.view.View.View.jumpDrawablesToCurrentState(ViewGroup.java:5158)上的android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158).位于android.view.View.View.jumpDrawablesTo的android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)的android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)上的ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)位于android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)的android.view.View.jumpDrawablesToCurrentState(ViewGroup.java:5158)上的CurrentState(ViewGroup.java:5158),位于android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java) :5158)在android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)at android位于android.view.ViewGroup的android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)的android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)的.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158). android.view.View.jumpDrawablesToCurrentState(ViewGroup.java:5158)在android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)的android.view.View.jumpDrawablesToCurrentState(ViewGroup.ja)上的jumpDrawablesToCurrentState(ViewGroup.java:5158)va:5158)在android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)的android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)上的android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158) android.view.View.View.View上的android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)安卓android.view.View上的android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)位于android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)的android.view.View.jumpDrawablesToCurrentState(ViewGroup.java:5158)的.jumpDrawablesToCurrentState(ViewGroup.java:5158)位于android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup. java:5158)在android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)的android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158)android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5158) android.view.ViewGr

pageradapter类:

public class pageradapter extends PagerAdapter {
    Context mContext;
    LayoutInflater mLayoutInflater;
    List<String> l = MainActivity.list;
    ImageLoader mImageLoader;

    public pageradapter(Context context) {
        mContext = context;

        mLayoutInflater = LayoutInflater.from(mContext.getApplicationContext());

    }

    @Override
    public int getCount() {
        return 4;
    }


    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        //  View itemView = mLayoutInflater.inflate(R.layout.img, container, false);
        //   ImageLoader mImageLoader = ImageLoader.getInstance();


        View view = mLayoutInflater.inflate(R.layout.createnew, container);

        //   ImageView imageView = (ImageView) …
Run Code Online (Sandbox Code Playgroud)

stack-overflow android android-layout android-viewpager android-pageradapter

7
推荐指数
1
解决办法
1958
查看次数

Android,如何启动活动锁定屏幕

我希望通过锁定屏幕上的推送通知启动我的活动,而无需更改锁定.

该活动的任何特殊许可?

android

7
推荐指数
2
解决办法
7367
查看次数

yii2验证输入数组

我有以下数据:

Array
(
    [category] => Array
        (
            [0] => d
            [1] => 100
            [2] => 100
            [3] => 100
        )

    [volume] => Array
        (
            [0] => 100
            [1] => 100
            [2] => 100
        )

    [urgency] => Array
        (
            [0] => 100
            [1] => 100
            [2] => 100
        )

    [importance] => Array
        (
            [0] => 100
            [1] => 100
            [2] => 100
        )
)
Run Code Online (Sandbox Code Playgroud)

我为它创建了DynamicModel规则"每个值应该是整数"(在2.0.4中添加).

$view_model = DynamicModel::validateData(compact('category', 'volume', 'urgency', 'importance'), [
        [['category', 'volume', 'urgency', 'importance'], 'each', 'rule' => ['integer']],
    ]); …
Run Code Online (Sandbox Code Playgroud)

yii2

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

向按钮提交按钮值但未能发布值

我知道我在这里犯了错误,但我一整天都在寻找这个.我使用了yii2框架,我还是新来的,我想访问partone/two页面,partone/two页面有两个提交按钮,一个用于添加行,第二个用于验证输入

PartoneController.php中

<?
public function actionTwo() { 

    if(\Yii::$app->user->isGuest) { 
        $this->goHome();
    } 

    $models = []; 
    $val = "" ;
        //Create array of items 
    Yii::trace("Lets start: ");

    if(Yii::$app->request->post('addRow') == 'true'){
      Yii::trace("hello");
      Model::loadMultiple($models, Yii::$app->request->post('items'));

      $model = new RelationForm();
      array_push($models, $model);
      return $this->render('two', ['items' => $models]); 
    } 

    if (Model::loadMultiple($models, Yii::$app->request->post('items')) && Model::validateMultiple($models)) 
    { 
        Yii::trace("hello again");
        $count = 0; 
        for($i = 0 ; $i < $models.length(); $i++){ 
            if(strpos($relationShownCurrently, '' + $i) !== FALSE){ 
                if(!$items[$i]->store()){ 
                    return $this->render('two', [ 'items' => $models …
Run Code Online (Sandbox Code Playgroud)

php yii2 yii2-advanced-app

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

根据方案设置默认模型值

我无法理清为什么设置默认值对我不起作用.

这是我的控制器:

class QueryController extends ActiveController

{
    public $modelClass = 'app\models\Query';
    public $createScenario = 'restCreate';
    public $updateScenario = 'restUpdate';
Run Code Online (Sandbox Code Playgroud)

我没有覆盖默认createAction方法.

模型:

 class Query extends ActiveRecord 
{public function rules()
{
    return [
        [['userId', 'name', 'created', 'isOneTime', 'isArchived', 'settings', 'engine'], 'required'],
        [['userId'], 'integer'],
        [['name', 'settings', 'schedule'], 'string'],
        [['created', 'lastUpdate'], 'safe'],
        [['isOneTime', 'isArchived', 'isApi', 'valid'], 'boolean'],
        [['state', 'engine'], 'string', 'max' => 160],
        [['isApi'], 'default', 'value'=> false],
        [['isApi'], 'default', 'value'=> true, 'on' => 'restCreate']
    ];
} 
public function scenarios()
    {
            $scenarios = …
Run Code Online (Sandbox Code Playgroud)

php yii2

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

Airlines.vim 在 tmux 中不起作用

我是 tmux 的新手,也不是 VIM 专家,这些天我尝试使用 tmux,但是当我在 tmux 中使用 vim 时,似乎航空公司消失了。我想向您展示屏幕截图,希望任何人都可以帮助我解决这个问题。

vim中的航空公司

tmux 内的航空公司

vim tmux statusline

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

不要连接用setText显示的文本.使用带占位符的资源字符串

我是android开发的新手,我想要setText一个数字,我正面临这个问题,并尝试了所有可能的方法来解决它.

请提供解决此问题的代码

代码如下:

public class GameActivity extends Activity implements View.OnClickListener{
    int correctAnswer;
    Button buttonObjectChoice1;
    Button buttonObjectChoice2;
    Button buttonObjectChoice3;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    //here we initialize all our varibles
    int partA = 9;
    int partB = 2;
    correctAnswer = partA * partB;
    int wrongAnswer1 = correctAnswer - 1;
    int wrongAnswer2 = correctAnswer + 1;
    TextView textObjectPartA = (TextView)findViewById(R.id.textPartA);
    TextView textObjectPartB = (TextView)findViewById(R.id.textPartB);
    buttonObjectChoice1 = (Button)findViewById(R.id.buttonChoice1);
    buttonObjectChoice2 = (Button)findViewById(R.id.buttonChoice2);
    buttonObjectChoice3 = (Button)findViewById(R.id.buttonChoice3);
    textObjectPartA.setText("" + partA);
    textObjectPartB.setText("" …
Run Code Online (Sandbox Code Playgroud)

java android settext

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

Yii2:用户更改密码后从所有浏览器注销

我想在更改当前密码时从所有浏览器中注销用户.在将新的passowrd保存到数据库之后,我已将代码放入我的控制器函数中:

$session = Yii::$app->session;
unset($session['id']);
unset($session['timestamp']);
$session->destroy();
Run Code Online (Sandbox Code Playgroud)

它仅适用于我更改密码的浏览器.但不适用于所有浏览器.我检查了会话变量 - $session['id']是否存在.即使我从不同的浏览器更改密码,我也可以看到它存在于其他浏览器中.

php session change-password yii2

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

用一只耳朵的方法进行多次战争的特定日志

一只耳朵有多个战争的特定日志。如何使用log4j2.xml进行配置,因为我无法在此找到任何帮助。我有一只耳朵有5次战争,当我配置日志时,所有战争日志都打印到只有一个首先由类loader.i加载的日志文件。我希望我的日志文件在每次战争中都可以单耳分离出来。我们将不胜感激。

java log4j2

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