小编pet*_*ieb的帖子

Windows 8上的Octave问题:出现任何错误后崩溃

我已在Windows 8上安装(并重新安装)Octave 3次,但我仍然无法正确使用它.第一个也是最明显的问题是缺少提示; 屏幕仅显示提示后面的闪烁下划线.这不是主要问题,因为系统正确响应命令.

主要问题是Octave在遇到语法错误时崩溃,而不是礼貌地给出诊断.这使得软件开发非常繁琐.

有没有解决这个问题的方法,或者我们只是等待一方或另一方提出住宿?

octave windows-8

19
推荐指数
3
解决办法
9780
查看次数

在LinearList对象上使用setOrientation方法

LinearLayout的setOrientation方法不接受参数VERTICAL,与android引用中的以下内容相反

public void setOrientation(int orientation)从:API级别1布局应该是列还是行.相关XML属性*android:orientation参数orientation通过HORIZONTAL或VERTICAL.默认值为HORIZONTAL.

我尝试使用import android.widget.LinearLayout尝试失败.*

通过黑客攻击,我能够发现1是垂直的,工作正常,但这是一个应该修复的错误.

android setorientation

16
推荐指数
2
解决办法
3万
查看次数

forceLayout(),requestLayout()

我对android文档的阅读发现方法forceLayout()(在下一个布局请求中产生布局显示)和requestLayout()(应该发布一个立即的布局请求),但是我无法让它们表现出来如宣传的那样.特别是,如果我在Thread.Sleep之前设置一个文本,然后在一个之后设置文本,它会在设置两个文本之前等待Sleep完成,无论是否在中间调用forceLayout()和requestLayout().请不要回答很多关于我不应该在UI线程中调用Thread.Sleep的废话.如果我将Thread.Sleep包装在CountDownTimer中,它可以很好地工作(只要我有足够短的滴答时间来不干扰睡眠时间,并且定时器的持续时间足够长以允许睡眠完成.以下是一个例子:

    int i=0;
TextView tv2;
TextView tv1;
LinearLayout ll;
Button bt;
@Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ll=new LinearLayout(this);
    ll.setOrientation(LinearLayout.VERTICAL);
    tv1=new TextView(this);
    tv2=new TextView(this);
    bt=new Button(this);
    bt.setText("Press to start");
    ll.addView(bt);
    ll.addView(tv1);
    ll.addView(tv2);
    tv2.setText("");
    setContentView(ll);
    bt.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            tv1.setText("starting sleep");
            new CountDownTimer(6000,50){
              public void onTick(long msuf)
                {if(i==1)
                    {
                try{
              Thread.sleep(4000);
              tv2.setText("waking up");
               }
            catch(InterruptedException e){};
            }
                i++;
                 }
               public void onFinish(){}}.start();
              }         
      });

        }
Run Code Online (Sandbox Code Playgroud)

android thread-sleep

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