小编Aru*_*l T的帖子

我应该使用什么库进行base64编码/解码

我使用base64编码进行身份验证,以联系点网服务器并进行图像解码.我应该包括哪个库.我觉得有点困惑.有人能帮我吗

android

3
推荐指数
1
解决办法
5058
查看次数

如何移动文本视图?

我在框架布局中有textview和imageview,我想用手指在图像上移动文本.

<FrameLayout 
     android:id="@+id/framelayout"
     android:layout_marginTop="30dip"
     android:layout_height="fill_parent" 
     android:layout_width="fill_parent">

     <ImageView 
          android:id="@+id/ImageView01"
          android:layout_height="wrap_content" 
          android:layout_width="wrap_content"/>

    <TextView android:id="@+id/text_view"
          android:layout_marginTop="30dip"
          android:layout_width="wrap_content" 
          android:maxLines="20"
          android:scrollbars="vertical"
          android:layout_height="wrap_content"/>

</FrameLayout>
Run Code Online (Sandbox Code Playgroud)

我尝试了一些代码,但它没有正常工作告诉我正确的方法.

    public boolean onTouch(View v, MotionEvent event) {

    float x1 = 0, x2, y1 = 0, y2;
    String direction;
    switch(event.getAction()) {
            case(MotionEvent.ACTION_DOWN):
                x1 = event.getX();
                y1 = event.getY();

                break;
            case(MotionEvent.ACTION_UP): {
                x2 = event.getX();
                y2 = event.getY();
                float dx = x2-x1;
                float dy = y2-y1;

                    // Use dx and dy to determine the direction
                if(Math.abs(dx) > Math.abs(dy)) {
                    if(dx>0) direction = "right"; …
Run Code Online (Sandbox Code Playgroud)

android move android-animation

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

动态地将列添加到tablerow.在循环中添加textview.settext无法正常工作

我有一个9行的表格布局.第一个是标题.但是列的数量不同.所以我需要动态地将textview添加到表格行.我填充表格行并添加固定的第一列的文本.其他coulmns iam试图在循环中添加它.但我只得到第一个细胞.

我的预期出局是这样的:

col#   A   B   C   D  E  F
----------------------------
1      65  6   6   5  6  7
----------------------------
2      6  4   7   4  6  8
Run Code Online (Sandbox Code Playgroud)

列的数量不能是3到6.但行数是8

我得到这样的出局:

 col#   
    ----------------------------
    1   
    ----------------------------
    2   
Run Code Online (Sandbox Code Playgroud)

我试图显示第一行.但我只得到第一个细胞.任何人都可以帮忙吗?

我的xml有一个表行

<?xml version="1.0" encoding="utf-8"?>

  <TableRow xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> 
        <TextView android:id="@+id/sn4"
                    android:textSize="25sp"
                    android:layout_marginTop="15dip"
                    android:layout_marginLeft="20dip"
                    style="@style/normalText"
                    android:textColor="@color/title"
             />



</TableRow>
Run Code Online (Sandbox Code Playgroud)

我有另一个xml的textview

<?xml version="1.0" encoding="utf-8"?>


    <TextView   xmlns:android="http://schemas.android.com/apk/res/android" 
                android:id="@+id/txtfactor"
                android:textSize="25sp"
                android:layout_marginTop="15dip"
                android:layout_marginLeft="20dip"
                style="@style/normalText"
                android:textColor="@color/title"
         />
Run Code Online (Sandbox Code Playgroud)

在我的代码中:

tbl =(TableLayout)findViewById(R.id.tbltrail); for(int i = 0; i <= noOfTrials; i ++){TableRow child =(TableRow)getLayoutInflater().inflate(R.layout.trial_table,null); child.setId(ⅰ); TextView …

android android-layout

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

标签 统计

android ×3

android-animation ×1

android-layout ×1

move ×1