微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

隐藏的标签栏将在文本字段聚焦时显示如何避免

如何解决隐藏的标签栏将在文本字段聚焦时显示如何避免

我正在使用 SwiftUI 的 tabview。我有使用以下方法显示和隐藏 tabview 特定页面方法

#include <iostream>

#include <vector>

#include <numeric>
#include <iterator>

using std::cout;

void printMatrixArray(std::size_t rowSize,const std::vector<int>& matArray){

    std::size_t elementCount = 1;
    std::vector<int>::const_iterator it = matArray.cbegin();

    for(std::size_t row = 0; row < rowSize; ++row){

        std::copy(it,it + elementCount,std::ostream_iterator<int>(cout,"\t"));
        cout<< '\n';

        it += elementCount;
        ++elementCount;
    }
}

std::vector<int> leftDiagonalBottomMatrix(const std::vector<std::vector<int>>& mat){

    std::vector<int> res;
    res.reserve(((1 + mat.size()) * mat.size()) / 2);

    std::vector<int>::size_type elementCount = 1;

    for(const std::vector<int>& row : mat){

        for(std::vector<int>::const_iterator it = row.cbegin(),endIt = row.cbegin() + elementCount; endIt != it; ++it){

            res.push_back(*it);
        }

        ++elementCount;
    }

    return res;
}

std::vector<int> multiplyMatrixArrays(const std::vector<int>& mat1Arr,const std::vector<int>& mat2Arr,std::vector<int>::size_type rowSize){

    std::vector<int> auxiliaryArray(rowSize);
    auxiliaryArray.front() = 0;

    std::iota(auxiliaryArray.begin() + 1,auxiliaryArray.end(),1);

    std::partial_sum(auxiliaryArray.cbegin(),auxiliaryArray.cend(),auxiliaryArray.begin());

    std::vector<int> res;
    res.reserve(mat1Arr.size());

    for(std::vector<int>::size_type row = 0; row < rowSize; ++row){

        for(std::vector<int>::size_type col = 0; col <= row; ++col){

            int val = 0;

            for(std::vector<int>::size_type ele = col,elementCount = row + 1; ele < elementCount; ++ele){

                val += mat1Arr[auxiliaryArray[row] + ele] * mat2Arr[auxiliaryArray[ele] + col];
            }

            res.push_back(val);
        }
    }

    return  res;
}

std::vector<int> matrixMultiply(const std::vector<std::vector<int>>& mat1,const std::vector<std::vector<int>>& mat2){

    return multiplyMatrixArrays(leftDiagonalBottomMatrix(mat1),leftDiagonalBottomMatrix(mat2),mat1.size());
}


int main(){

    std::vector<std::vector<int>> mat1{{1,0},{2,3,{4,1,{1,9,2,2}};

    std::vector<std::vector<int>> mat2{{2,{0,2}};

    printMatrixArray(mat1.size(),matrixMultiply(mat1,mat2));
}

使用此方法 tabview hidden 工作正常。在隐藏标签页中,当焦点显示文本字段 tabview 时。如何处理这个

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。